Created
April 27, 2012 13:55
-
-
Save vekexasia/2509477 to your computer and use it in GitHub Desktop.
Xss Injection Post on andreabaccega.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a href='http://www.example.com' onClick='javascript:alert("blabla");'>Click Me!</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Allow only a couple of tags + Strip Slashes + Remove any attribute | |
* / | |
$almostSafeOutput = preg_replace( | |
"/<([a-z][a-z0-9]*)[^>]*?(\/?)>/i", | |
'<$1$2>', | |
stripslashes( | |
strip_tags( | |
$toStrip, | |
'<p><a><b><i><em><u><ul><li><ol><span><div>' | |
) | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment