Created
October 3, 2014 22:15
-
-
Save ssx/d9dba534f39ee056d0b5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| Test String: | |
| < echo "Hello O'Test"; ?> | |
| FILTER_SANITIZE_STRING: | |
| string(0) "" | |
| FILTER_UNSAFE_RAW with flags: FILTER_FLAG_STRIP_LOW, | |
| FILTER_FLAG_STRIP_HIGH, | |
| FILTER_FLAG_ENCODE_LOW, | |
| FILTER_FLAG_ENCODE_HIGH, | |
| FILTER_FLAG_ENCODE_AMP: | |
| string(25) "< echo "Hello O'Test"; ?>" |
This file contains hidden or 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 | |
| $strTestString = "< echo \"Hello O'Test\"; ?>"; | |
| echo "Test String: ".PHP_EOL; | |
| echo $strTestString.PHP_EOL; | |
| echo PHP_EOL; | |
| echo "FILTER_SANITIZE_STRING: ".PHP_EOL; | |
| echo var_dump(filter_var($strTestString, FILTER_SANITIZE_STRING)); | |
| echo PHP_EOL; | |
| echo "FILTER_UNSAFE_RAW: ".PHP_EOL; | |
| echo var_dump(filter_var($strTestString, FILTER_UNSAFE_RAW, array( | |
| FILTER_FLAG_STRIP_LOW, | |
| FILTER_FLAG_STRIP_HIGH, | |
| FILTER_FLAG_ENCODE_LOW, | |
| FILTER_FLAG_ENCODE_HIGH, | |
| FILTER_FLAG_ENCODE_AMP | |
| ))).PHP_EOL; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment