Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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 Otherwise, you're in risky business trusting what a user could send you.


Especially since you could otherwise inject "/e" which turns the whole thing into an eval() !


SERIOUSLY!? eval() from regexes!?

Jebus... Just burn it all down, we're screwed.


From the documentation for regex modifiers: "DEPRECATED as of PHP 5.5.0 and REMOVED as of PHP 7.0.0". Not for much longer.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: