note 38154 added to function.addslashes
| From: | matthew dot eastman at hotpop dot com | Date: | Wed, 10 Dec 2003 02:22:34 +0000 |
| Subject: | note 38154 added to function.addslashes | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-61721@lists.php.net to get a copy of this message | ||
Here's a really simple way to make sure that magic quotes are always used for your program
regardless of the php.ini setting:
function safe_quotes(&$given)
{
if (is_array($given))
array_walk($given, 'safe_quotes');
else
$given = addslashes($given);
}
if (!get_magic_quotes_gpc())
{
$bigarray = array(&$_GET, &$_POST, &$_COOKIES);
safe_quotes($bigarray);
}
----
Manual Page -- http://www.php.net/manual/en/function.addslashes.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+38154
Delete -- http://master.php.net/manage/user-notes.php?action=delete+38154&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+38154&report=yes
Search -- http://master.php.net/manage/user-notes.php