1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00

Fix "%f" regex in run-tests.php (#8965)

"-.0.0" and "0." is no longer matched wrongly
This commit is contained in:
Michael Voříšek
2022-07-10 15:33:10 +02:00
committed by GitHub
parent d217a669fc
commit 6cd5bd1bcd

View File

@@ -2583,10 +2583,9 @@ COMMAND $cmd
$wanted_re = str_replace('%i', '[+-]?\d+', $wanted_re);
$wanted_re = str_replace('%d', '\d+', $wanted_re);
$wanted_re = str_replace('%x', '[0-9a-fA-F]+', $wanted_re);
$wanted_re = str_replace('%f', '[+-]?\.?\d+\.?\d*(?:[Ee][+-]?\d+)?', $wanted_re);
$wanted_re = str_replace('%f', '[+-]?(?:\d+|(?=\.\d))(?:\.\d+)?(?:[Ee][+-]?\d+)?', $wanted_re);
$wanted_re = str_replace('%c', '.', $wanted_re);
$wanted_re = str_replace('%0', '\x00', $wanted_re);
// %f allows two points "-.0.0" but that is the best *simple* expression
}
if (preg_match("/^$wanted_re\$/s", $output)) {