diff options
| author | Anatol Belski <ab@php.net> | 2018-09-12 16:25:39 +0200 |
|---|---|---|
| committer | Anatol Belski <ab@php.net> | 2018-09-12 16:25:39 +0200 |
| commit | ed5262b589384c33cf794eaf1ec8d71170276e6b (patch) | |
| tree | 63e7547635e67f044b6904943fe6e9b8e70db8ff | |
| parent | a14b69e114cbdc5b376e9d231e5684190dd9f14d (diff) | |
| parent | 05a4fec76119696ec50b920ec783cca5e6eca31c (diff) | |
| download | php-git-ed5262b589384c33cf794eaf1ec8d71170276e6b.tar.gz | |
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
Improve error code matching
| -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; } |
