diff options
author | Anatol Belski <ab@php.net> | 2018-09-12 16:26:26 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2018-09-12 16:26:26 +0200 |
commit | 8a8edac8a5c1148e20c0496246f40829a6a497f4 (patch) | |
tree | 8cd295df18749da112a6fb202bd3133f9fb4cb40 /ext/openssl | |
parent | 385ffea3ab06fde8aaf87b47aaacc927e9aec635 (diff) | |
parent | ed5262b589384c33cf794eaf1ec8d71170276e6b (diff) | |
download | php-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.phpt | 4 |
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; } |