On Tue, 8 Feb 2005 20:29:47 +0100
"Alvaro G. Vicario" <kA*****************@terra.es> wrote:
*** Honky Tonk Hero escribió/wrote (Tue, 08 Feb 2005 18:15:24
GMT): I have a premade for that is having probelms dealing with
aposterphies and forward slahes. Is there a way to edit the
code so it does not alter aposterphies and forward slahes?
Example:
If I enter ' the form displays it as /'
If I enter / the for displays it as //
It's a pretty stupid "feature" that PHP has. It can either be
enabled or disabled, in your server it seems to be enabled.
Check this:
Yeah, totally useless.
[...]
You can either disable it (if it's possible) or use code to
detect it and act accordingly.
Yes, and it's better not to depend on the server. Here's a way:
$r = get_magic_quotes_gpc();
function strip_r($v) {
$v = is_array($v) ?
array_map('strip_r',$v) : stripslashes($v);
return $v;
}
if ($r) {
$_POST = array_map('strip_r', $_POST);
$_GET = array_map('strip_r', $_GET);
$_COOKIE = array_map('strip_r', $_COOKIE);
}
And for runtime magic quotes,
$i = get_magic_quotes_runtime();
$r = set_magic_quotes_runtime(0);
if($i)
if (!$r)
print "Can't set. Can't help.\n";