facebookarchive / pfff

Tools for code analysis, visualizations, or style-preserving source transformation.
http://github.com/facebook/pfff/wiki/Main
Other
2.44k stars 204 forks source link

Support "!..." as not-a-string pattern. #119

Closed mutantzombie closed 9 years ago

mutantzombie commented 9 years ago

When using sgrep to search for insecure PHP code, I've found it useful to be able to ignore function arguments that are hard-coded strings. For example, making an assumption that a hard-coded string argument to a function like popen() is probably(!?) okay, but an argument with variable substitution is more suspect and should receive more follow up.

Rather than put together complex patterns with metavariables, it's been easier to say, "not a string" with a pattern of "!...". That pattern is intended to echo the "..." for matching any string.

Thanks, Mike