/** * Removes slashes from all scalar array values recursively * @param array $target Target array * @param boolean $magic_quotes_sybase Use magic_quotes_sybase stripping only? * @return array Array with stripped slashes */ function stripSlashesRecursive($target, $magic_quotes_sybase = false) { if (!empty($target) && is_array($target)) { foreach ($target as $key => $val) { if (is_array($val)) { // Value is an array. Start recursion. $target[$key] = PCPIN_Common::stripSlashesRecursive($val, $magic_quotes_sybase); } elseif (is_scalar($val)) { // Strip slashes from scalar value if ($magic_quotes_sybase) { $target[$key] = str_replace("''", "'", $val); } else { $target[$key] = stripslashes($val); } } else { // Leave value unchanged. $target[$key] = $val; } } } return $target; }
} if (!empty($_pcpin_init_session->_s_id) && $l->id != $_pcpin_init_session->_s_language_id) { $_pcpin_init_session->_s_updateSession($_pcpin_init_session->_s_id, true, true, $l->id); } unset($_pcpin_set_language); } } /** * Strip magic quotes from GPC vars and extract them into the global scope. * This software uses own security algorithm to prevent SQL injections. */ if (get_magic_quotes_gpc()) { $_pcpin_magic_quotes_sybase = ini_get('magic_quotes_sybase') == '1'; $_GET = PCPIN_Common::stripSlashesRecursive($_GET, $_pcpin_magic_quotes_sybase); $_POST = PCPIN_Common::stripSlashesRecursive($_POST, $_pcpin_magic_quotes_sybase); $_COOKIE = PCPIN_Common::stripSlashesRecursive($_COOKIE, $_pcpin_magic_quotes_sybase); // $_SESSION=PCPIN_Common::stripSlashesRecursive($_SESSION, $_pcpin_magic_quotes_sybase); // <-- not needed yet unset($_pcpin_magic_quotes_sybase); } /** * Yes, we extract GPC+F superglobals into the global scope. * This software knows, how to handle them. */ // $_GET vars extract($_GET); // $_POST vars extract($_POST); // $_COOKIE vars $_pcpin_cookies_found = !empty($_COOKIE); //extract($_COOKIE); // <- not needed yet // Posted files into the global scope