summaryrefslogtreecommitdiff
path: root/ext/openssl
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2018-09-12 16:26:26 +0200
committerAnatol Belski <ab@php.net>2018-09-12 16:26:26 +0200
commit8a8edac8a5c1148e20c0496246f40829a6a497f4 (patch)
tree8cd295df18749da112a6fb202bd3133f9fb4cb40 /ext/openssl
parent385ffea3ab06fde8aaf87b47aaacc927e9aec635 (diff)
parented5262b589384c33cf794eaf1ec8d71170276e6b (diff)
downloadphp-git-8a8edac8a5c1148e20c0496246f40829a6a497f4.tar.gz
Merge branch 'PHP-7.3'
* PHP-7.3: Improve error code matching
Diffstat (limited to 'ext/openssl')
-rw-r--r--ext/openssl/tests/openssl_error_string_basic.phpt4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/openssl/tests/openssl_error_string_basic.phpt b/ext/openssl/tests/openssl_error_string_basic.phpt
index 06ce195ae0..834f2f8636 100644
--- a/ext/openssl/tests/openssl_error_string_basic.phpt
+++ b/ext/openssl/tests/openssl_error_string_basic.phpt
@@ -8,8 +8,8 @@ openssl_error_string() tests
function expect_openssl_errors($name, $expected_error_codes) {
$expected_errors = array_fill_keys($expected_error_codes, false);
while (($error_string = openssl_error_string()) !== false) {
- if (strlen($error_string) > 14) {
- $error_code = substr($error_string, 6, 8);
+ if (preg_match(",.+:([0-9A-F]+):.+,", $error_string, $m) > 0) {
+ $error_code = $m[1];
if (isset($expected_errors[$error_code])) {
$expected_errors[$error_code] = true;
}