Skip to content

Commit d8a17ca

Browse files
authored
Fix test failures in engine_unsafe_empty_string.phpt (php#18727)
`/./` matches all characters but newlines, so if `random_bytes` generates a string with newlines in it, the resulting string is not empty. Fix this by adding the `s` modifier.
1 parent d39d261 commit d8a17ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/random/tests/03_randomizer/engine_unsafe_empty_string.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ final class EmptyStringEngine implements Engine
1111
public function generate(): string
1212
{
1313
// Create a non-interned empty string.
14-
return preg_replace('/./', '', random_bytes(4));
14+
return preg_replace('/./s', '', random_bytes(4));
1515
}
1616
}
1717

0 commit comments

Comments
 (0)