ouzo icon indicating copy to clipboard operation
ouzo copied to clipboard

Is `Strings` vulnerable to regexp injection by design?

Open danon opened this issue 7 years ago • 0 comments

This usage emits a warning and reveals underlying implementation:

Strings::sprintAssoc("This is %{what}! %{what}? This is %{+}!", [
    '+' => 'madness',
]);
preg_replace(): Compilation failed: nothing to repeat at offset 3

And also, you can't use unquoted slash /.

Strings::replaceNth($uri, 'http://www', '', 2);
preg_match_all(): Unknown modifier 'w'

Is this by design?

danon avatar Oct 04 '18 12:10 danon