if (get_magic_quotes_gpc() == 1) { // Magic quotes *should* be off, but just in case... $superglobals = array(&$_REQUEST, &$_GET, &$_POST, &$_COOKIE); foreach ($superglobals as &$superglobal) { $superglobal = removeMagicQuotes($superglobal); } } function removeMagicQuotes($data) { if (is_array($data) == false) { $data = stripslashes($data); } else foreach ($data as &$value) { $value = Helper::removeMagicQuotes($value); } return $data; }