Skip to content

Commit

Permalink
Improve error code matching
Browse files Browse the repository at this point in the history
  • Loading branch information
weltling committed Sep 12, 2018
1 parent 49511a5 commit 19ab917
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ext/openssl/tests/openssl_error_string_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 19ab917

Please sign in to comment.