6 ms·
Anyone compiling regex strings in PHP from user input should take care to use preg_quote(): http://php.net/manual/en/function.preg-quote.php http://php.net/manu
by trebor 11y ago
Anyone compiling regex strings in PHP from user input should take care to use preg_quote(): http://php.net/manual/en/function.preg-quote.php http://php.net/manual/en/function.preg-quote.php Otherwise, you're in risky business trusting what a user could send you.
- 0x0 11y agoEspecially since you could otherwise inject "/e" which turns the whole thing into an eval() !
- Sophistifunk 11y agoSERIOUSLY!? eval() from regexes!? Jebus... Just burn it all down, we're screwed.
- developer1 11y agoFrom the documentation for regex modifiers: "DEPRECATED as of PHP 5.5.0 and REMOVED as of PHP 7.0.0". Not for much longer.