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:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user