note 107663 deleted from function.stripslashes by danbrown
| From: | danbrown@php.net | Date: | Thu, 10 May 2012 20:22:53 +0000 |
| Subject: | note 107663 deleted from function.stripslashes by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-187791@lists.php.net to get a copy of this message | ||
Note Submitter: qeremy [atta] gmail [dotta] com
----
For this note: http://www.php.net/manual/en/function.addslashes.php#107661
// Unescaping query result (if you need after fetching it);
<?php
function unescape_query($str) {
return strtr($str, array(
"'" => "'",
""" => "\"",
"\" => "\\",
"<" => "<",
">" => ">",
));
}
?>
// '"\
echo unescape_query("'"\");
// <script>alert(1)</script>
echo unescape_query("<script>alert(1)</script>");