note 31898 added to configuration
| From: | allen at rack1 dot php dot net | Date: | Thu, 08 May 2003 09:37:20 +0000 |
| Subject: | note 31898 added to configuration | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-47682@lists.php.net to get a copy of this message | ||
In reference to the post by php dot net at odi dot ch
Yes magic_quotes is slightly evil, but we have to live with it, and to be honest its not a problem,
I now have a file which runs these sorts of chekcs thats included at the beginning of the script. My
code for magic quotes looks like this:
// 'Turn off' magic_quotes_gpc
if (get_magic_quotes_gpc ()) {
foreach ($_POST as $key => $value) {
$_POST[$key] = stripslashes ($value);
}
foreach ($_GET as $key => $value) {
$_GET[$key] = stripslashes ($value);
}
foreach ($_COOKIE as $key => $value) {
$_COOKIE[$key] = stripslashes ($value);
}
}
So saying that the behavious cannot be modified at runtime is actually incorrect.
I'm even creating a new template database script which allows me to easily work around the more
evil magic_quotes_runtime by writing my own database routines (the script is in fact designed for
small databases and can be run either using flatfiles or MySQL).
It would make my life way easier if they removed safe mode from PHP, but it isn't going to
happen. Live with it and love it :)
Allen
--
http://www.php.net/manual/en/configuration.php
http://master.php.net/manage/user-notes.php?action=edit+31898
http://master.php.net/manage/user-notes.php?action=delete+31898
http://master.php.net/manage/user-notes.php?action=reject+31898