function r_stripslashes(&$array)
{
    while (list($k, $v) = each($array)) {
        if ($k != 'argc' && $k != 'argv' && (strtoupper($k) != $k || '' . intval($k) == "{$k}")) {
            if (is_string($v)) {
                $array[$k] = stripslashes($v);
            }
            if (is_array($v)) {
                $array[$k] = r_stripslashes($v);
            }
        }
    }
    return $array;
}
Exemple #2
0
function r_stripslashes($string)
{
    if (isset($string)) {
        foreach ($string as $key => $value) {
            if (is_array($value)) {
                $string[$key] = r_stripslashes($value);
            } else {
                $string[$key] = stripslashes($value);
            }
        }
        return $string;
    } else {
        return FALSE;
    }
}
Exemple #3
0
}
// php 4.1+
if (isset($HTTP_GET_VARS)) {
    extract($HTTP_GET_VARS, EXTR_SKIP);
}
if (isset($HTTP_PUT_VARS)) {
    extract($HTTP_PUT_VARS, EXTR_SKIP);
}
if (isset($HTTP_POST_VARS)) {
    extract($HTTP_POST_VARS, EXTR_SKIP);
}
if (get_magic_quotes_gpc() && is_array($GLOBALS)) {
    $HTTP_GET_VARS = r_stripslashes($HTTP_GET_VARS);
    $HTTP_POST_VARS = r_stripslashes($HTTP_POST_VARS);
    $HTTP_COOKIE_VARS = r_stripslashes($HTTP_COOKIE_VARS);
    $GLOBALS = r_stripslashes($GLOBALS);
}
error_reporting(7);
// E_ERROR | E_WARNING | E_PARSE
set_magic_quotes_runtime(0);
if ($REMOTE_ADDR == '127.0.0.1') {
    $REMOTE_ADDR = $HTTP_X_FORWARDED_FOR;
}
$mysql = @mysql_connect($mysql_h, $mysql_u, $mysql_p);
$db = @mysql_select_db($mysql_db, $mysql);
if ($l_username) {
    $r_user = query("SELECT userid, username FROM " . $pref . "user WHERE username='******' AND userpassword='******' AND userisadmin=1");
    if (mysql_num_rows($r_user) == 1) {
        $user = mysql_fetch_array($r_user);
        $session = md5(time() . "Kfjasdl(84939qjKJASDldf.y<.yj48hh" . microtime());
        query("INSERT INTO " . $pref . "session (sessionid, lastaction, userid, username, ip)\n            VALUES ('{$session}', " . time() . ", '{$user['userid']}', '" . addslashes($user['username']) . "', '{$REMOTE_ADDR}')");