From fa51e2caab18bf66e1453185cbea49a59e25b2fa Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 20 Dec 2007 23:56:53 +0000 Subject: [PATCH] fix for magic_quotes_gpc --- admin/remote.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/admin/remote.php b/admin/remote.php index 6668d86415..0ade9ee5ca 100644 --- a/admin/remote.php +++ b/admin/remote.php @@ -83,6 +83,35 @@ $data['creator'] = 0; // remote if (isset($data['modifier'])) $data['modifier'] = 0; if (isset($data['requested'])) $data['requested'] = 0; +if (get_magic_quotes_gpc()) +{ + $data = array_stripslashes($data); +} + +/** + * Strip all slashes from an array + * + * @param mixed $subject + * @return mixed + */ +function array_stripslashes($subject) +{ + if (is_string($subject)) + { + return stripslashes($subject); + } + if (!is_array($subject)) + { + return ($subject); + } + $ret = array(); + foreach ($subject as $key => $value) + { + $ret[$key] = array_stripslashes($value); + } + return $ret; +} + // instanciate comand and run it $cmd = admin_cmd::instanciate($data);