Example #1
0
/**
 * Strips all slashes from the specified array in place (pass by ref).
 * @param Array The array to strip slashes from, typically one of
 *                     $_GET, $_POST, or $_COOKIE.
 */
function array_stripslashes(&$array) {
	if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
		debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs);

	if (is_array($array))
		while (list($key) = each($array))
			if (is_array($array[$key]) && $key != $array)
				array_stripslashes($array[$key]);
			else
				$array[$key] = stripslashes($array[$key]);
}
Example #2
0
function array_stripslashes($string)
{
    if (is_array($string)) {
        foreach ($string as $key => $val) {
            $string[$key] = array_stripslashes($val);
        }
    } else {
        $string = stripslashes($string);
    }
    return $string;
}
Example #3
0
function array_stripslashes(&$array)
{
    if (is_array($array)) {
        while (list($key) = each($array)) {
            if (is_array($array[$key])) {
                array_stripslashes($array[$key]);
            } else {
                $array[$key] = stripslashes($array[$key]);
            }
        }
    }
}
Example #4
0
function array_stripslashes(&$var)
{
    if (is_string($var)) {
        $var = stripslashes($var);
    } else {
        if (is_array($var)) {
            foreach ($var as $key => $value) {
                array_stripslashes($var[$key]);
            }
        }
    }
}
    while (list($var, ) = @each($input)) {
        if (!in_array($var, $not_unset)) {
            unset(${$var});
            // Testen
            if (isset($GLOBALS[$var])) {
                unset($GLOBALS[$var]);
            }
        }
    }
    unset($input);
}
// End
if (get_magic_quotes_gpc() == 1) {
    while (list($key, $value) = each($_GET)) {
        $_GET[$key] = array_stripslashes($value);
    }
    while (list($key, $value) = each($_POST)) {
        $_POST[$key] = array_stripslashes($value);
    }
    while (list($key, $value) = each($_REQUEST)) {
        $_REQUEST[$key] = array_stripslashes($value);
    }
}
foreach ($_REQUEST as $key => $value) {
    if (is_array($value)) {
        $value = array_map('addslashes', $value);
    } else {
        $value = addslashes($value);
    }
    $_REQUEST[$key] = $value;
}
Example #6
0
/**
 * This function will walk recursivly thorugh array and strip slashes from scalar values
 *
 * @param array $array
 * @return null
 */
function array_stripslashes(&$array)
{
    if (!is_array($array)) {
        return;
    }
    foreach ($array as $k => $v) {
        if (is_array($array[$k])) {
            array_stripslashes($array[$k]);
        } else {
            $array[$k] = stripslashes($array[$k]);
        }
        // if
    }
    // foreach
    return $array;
}
Example #7
0
        # set LC_ALL to de_DE
        bindtextdomain('messages', LANGDIR);
        bind_textdomain_codeset('messages', 'UTF-8');
        textdomain('messages');
        header('Content-type: text/html; charset=UTF-8', true);
    }
}
/**
 * Strip slashes from GET, POST, and COOKIE variables if this
 * PHP install is configured to automatically addslashes()
 */
if (@get_magic_quotes_gpc() && (!isset($slashes_stripped) || !$slashes_stripped)) {
    array_stripslashes($_REQUEST);
    array_stripslashes($_GET);
    array_stripslashes($_POST);
    array_stripslashes($_COOKIE);
    $slashes_stripped = true;
}
# Create our application repository variable.
$app['server'] = $_SESSION[APPCONFIG]->getServer(get_request('server_id', 'REQUEST'));
/**
 * Look/evaluate our timeout
 */
if (!$app['server']->isSessionValid()) {
    system_message(array('title' => _('Session Timed Out'), 'body' => sprintf('%s %s %s', _('Your Session timed out after'), $app['server']->getValue('login', 'timeout'), _('min. of inactivity. You have been automatically logged out.')), 'type' => 'info'), sprintf('index.php?server_id=%s&refresh=SID_%s', $app['server']->getIndex(), $app['server']->getIndex()));
    die;
}
# If syslog is enabled, we need to include the supporting file.
if ($_SESSION[APPCONFIG]->getValue('debug', 'syslog')) {
    require LIBDIR . 'syslog.php';
}
Example #8
0
 protected function configure()
 {
     @mb_internal_encoding('UTF-8');
     @ini_set('default_charset', 'utf-8');
     @ini_set('register_globals', 'off');
     // magic quotes
     @ini_set("magic_quotes_runtime", 0);
     if (version_compare('5.4', PHP_VERSION, '>') && function_exists('set_magic_quotes_runtime') && get_magic_quotes_runtime()) {
         @set_magic_quotes_runtime(false);
     }
     // IIS
     if (!isset($_SERVER['REQUEST_URI'])) {
         $_SERVER['REQUEST_URI'] = $_SERVER['PHP_SELF'];
         if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING'])) {
             $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
         }
         self::$system_options['mod_rewrite'] = false;
     }
     if (!get_magic_quotes_gpc()) {
         return;
     }
     function array_stripslashes($array)
     {
         return is_array($array) ? array_map("array_stripslashes", $array) : stripslashes($array);
     }
     $_GET = array_stripslashes($_GET);
     $_POST = array_stripslashes($_POST);
     $_COOKIE = array_stripslashes($_COOKIE);
     $_REQUEST = array_stripslashes($_REQUEST);
 }
Example #9
0
/**
 * Strips all slashes from the specified array in place (pass by ref).
 * @param Array $array The array to strip slashes from, typically one of
 *             $_GET, $_POST, or $_COOKIE.
 */
function array_stripslashes(&$array)
{
    if (DEBUG_ENABLED) {
        debug_log('array_stripslashes(): Entered with (%s)', 1, $array);
    }
    if (is_array($array)) {
        while (list($key) = each($array)) {
            if (is_array($array[$key]) && $key != $array) {
                array_stripslashes($array[$key]);
            } else {
                $array[$key] = stripslashes($array[$key]);
            }
        }
    }
}
Example #10
0
function array_stripslashes(&$var)
{
    if (is_array($var)) {
        foreach ($var as $k => &$v) {
            array_stripslashes($v);
        }
    } else {
        $var = stripslashes($var);
    }
    return $var;
}
Example #11
0
/**
 * Strips slashes from a var if magic_quotes_gqc is enabled
 *
 * @param mixed $data
 * @return mixed
 */
function strip_if_magic($data)
{
    if (MAGIC_QUOTES_GPC == true) {
        return array_stripslashes($data);
    } else {
        return $data;
    }
}
Example #12
0
                // View_
                require_once VIEWS_PATH . substr($classPath, 5);
                break;
            case 5:
                // Model_
                require_once MODELS_PATH . substr($classPath, 6);
                break;
        }
    }
}
set_error_handler(create_function('$errno, $errstr, $errfile, $errline', '
	throw new ErrorException($errstr, $errno, 0, $errfile, $errline);
'), E_ALL & ~E_NOTICE);
function array_stripslashes($item)
{
    return is_array($item) ? array_map('array_stripslashes', $item) : stripslashes($item);
}
if (get_magic_quotes_gpc()) {
    if ($_GET) {
        $_GET = array_stripslashes($_GET);
    }
    if ($_POST) {
        $_POST = array_stripslashes($_POST);
    }
    if ($_COOKIES) {
        $_COOKIES = array_stripslashes($_COOKIES);
    }
    if ($_REQUEST) {
        $_REQUEST = array_stripslashes($_REQUEST);
    }
}
function array_stripslashes(&$array)
{
    while (list($key, $var) = each($array)) {
        if ((strtoupper($key) != $key || '' . intval($key) == "{$key}") && $key != 'argc' && $key != 'argv') {
            if (is_string($var)) {
                $array[$key] = stripslashes($var);
            }
            if (is_array($var)) {
                $array[$key] = array_stripslashes($var);
            }
        }
    }
    return $array;
}