Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/4.2.2 #347

Merged
merged 12 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Yoti Support
url: https://support.yoti.com/yotisupport/s/contactsupport
about: Please send your questions or issues here.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "yoti/yoti-php-sdk",
"description": "Yoti SDK for quickly integrating your PHP backend with Yoti",
"version": "4.2.1",
"version": "4.2.2",
"keywords": [
"yoti",
"sdk"
Expand Down
3 changes: 2 additions & 1 deletion examples/profile/resources/views/partial/report.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
</tr>
</thead>
<tbody>
@if (isset($value) && is_array($value))
@foreach ($value as $name => $result)
@if (is_array($result))
@foreach ($result as $data => $view)
Expand All @@ -33,7 +34,7 @@
</tr>
@endif
@endforeach

@endif
</tbody>
</table>
@endforeach
2 changes: 1 addition & 1 deletion src/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Constants
public const SDK_IDENTIFIER = 'PHP';

/** Default SDK version */
public const SDK_VERSION = '4.2.1';
public const SDK_VERSION = '4.2.2';

/** Base url for connect page (user will be redirected to this page eg. baseurl/app-id) */
public const CONNECT_BASE_URL = 'https://www.yoti.com/connect';
Expand Down
2 changes: 1 addition & 1 deletion src/Profile/Util/Attribute/AnchorConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private static function convertCertToX509(string $certificate): \stdClass
}
});

$decodedX509Data = Json::decode(Json::encode($X509Data), false);
$decodedX509Data = Json::decode(Json::encode(Json::convert_from_latin1_to_utf8_recursively($X509Data)), false);

// Ensure serial number is cast to string.
// @see \phpseclib\Math\BigInteger::__toString()
Expand Down
18 changes: 18 additions & 0 deletions src/Util/Json.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,22 @@ private static function validate(): void
throw new JsonException(json_last_error_msg(), json_last_error());
}
}

public static function convert_from_latin1_to_utf8_recursively($dat)
{
if (is_string($dat)) {
return utf8_encode($dat);
} elseif (is_array($dat)) {
$ret = [];
foreach ($dat as $i => $d) $ret[ $i ] = self::convert_from_latin1_to_utf8_recursively($d);

return $ret;
} elseif (is_object($dat)) {
foreach ($dat as $i => $d) $dat->$i = self::convert_from_latin1_to_utf8_recursively($d);

return $dat;
} else {
return $dat;
}
}
}
Loading