note 94757 added to security.magicquotes.disabling
| From: | eugene at ultimatecms dot co dot za | Date: | Mon, 23 Nov 2009 12:59:04 +0000 |
| Subject: | note 94757 added to security.magicquotes.disabling | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-163185@lists.php.net to get a copy of this message | ||
<?php
function no_magic_quotes($query) {
$data = explode("\\",$query);
$cleaned = implode("",$data);
return $cleaned;
}
// I'm using mysql_escape_string as a simple example, but this function would work for any
escaped string.
$query = "It's amaizing! Who's to say this isn't a simple function?";
$badstring = mysql_escape_string($query);
echo '<b>Without funtion:</b> '.$badstring;
echo '<br><br>';
echo '<b>With function:</b> '.no_magic_quotes($badstring);
?>
Output:
Without funtion: It\'s amaizing! Who\'s to say this isn\'t a simple function?
With function: It's amaizing! Who's to say this isn't a simple function?
----
Server IP: 69.147.83.197
Probable Submitter: 196.25.255.214
----
Manual Page -- http://www.php.net/manual/en/security.magicquotes.disabling.php
Edit -- https://master.php.net/note/edit/94757
Del: integrated -- https://master.php.net/note/delete/94757/integrated
Del: useless -- https://master.php.net/note/delete/94757/useless
Del: bad code -- https://master.php.net/note/delete/94757/bad+code
Del: spam -- https://master.php.net/note/delete/94757/spam
Del: non-english -- https://master.php.net/note/delete/94757/non-english
Del: in docs -- https://master.php.net/note/delete/94757/in+docs
Del: other reasons-- https://master.php.net/note/delete/94757
Reject -- https://master.php.net/note/reject/94757
Search -- https://master.php.net/manage/user-notes.php