-
-
Notifications
You must be signed in to change notification settings - Fork 493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XSS EscapeOutput: should we sniff for throw ? #884
Comments
Interesting suggestion. I'd say the difference here is that But I guess there is still the potential danger, and so escaping would be a good precaution (like we do with functions used to trigger errors). One issue would be that an exception object could be constructed prior to actually being thrown. So you'd end up with code like this: throw $exception; But we could call that an edge-case and flag it as a warning or something. |
What with nearly every PHP native error having been turned into an exception in PHP 7, I'd say very few are actually caught .... But I suppose you're talking about userland Exceptions 😎 |
Note that UPDATE: As @JDGrimes says above:
😄 |
My question is of course related to #764 / making the sniffs compatible with modern PHP code. |
Aside: |
@westonruter 💯 I realized that as soon as I hit "Comment" (of course) ;-) |
My email has proof of this 😄 |
😊 Note to self: ALWAYS look EVERYTHING up. Now I need 🍷 |
GH should send those emails out with a five minute delay or something - I always catch a spelling mistake or something else after I post (even after proof reading) |
… for exception creation in `throw` statements and expressions for correct escaping. See WordPress/WordPress-Coding-Standards#884.
Just like
die()
orexit()
,throw
will send to the screen unless the Exception is caught.Should we start checking throw statements for output escaping ?
Ref: http://php.net/manual/en/language.exceptions.php
The text was updated successfully, but these errors were encountered: