Exemple #1
0
function hg_init_input($data = array())
{
    $ret = array();
    $data = or_get($data, array_merge($_GET, $_POST));
    foreach ($data as $k => $v) {
        $ret[hg_clean_key($k)] = is_array($v) ? hg_init_input($v) : hg_clean_value($v);
    }
    return $ret;
}
Exemple #2
0
    }
    define('SAFE_MODE', @ini_get('safe_mode') || @strtolower(ini_get('safe_mode')) == 'on' ? true : false);
} else {
    define('MAGIC_QUOTES_GPC', false);
    define('SAFE_MODE', false);
}
if (!defined('WITHOUT_DB') || !WITHOUT_DB) {
    $gDB = hg_ConnectDB();
}
/*/用户输入安全过滤
foreach (array('_REQUEST', '_GET', '_POST', '_COOKIE', '_FILES', '_SERVER') as $v)
{
	$$v = hg_addslashes($$v);
}
*/
$_INPUT = hg_init_input();
register_shutdown_function('hg_done');
function hg_done()
{
    global $gDB;
    if ($gDB) {
        $gDB->close();
    }
}
/**
* 创建db
*/
function hg_ConnectDB()
{
    global $gDBconfig, $gDB;
    if (!$gDB && $gDBconfig['host']) {
Exemple #3
0
        }
        if (is_array($_FILES)) {
            foreach ($_FILES as $key => $val) {
                $_FILES[$key]['tmp_name'] = str_replace('\\', '\\\\', $val['tmp_name']);
            }
        }
        foreach (array('_REQUEST', '_GET', '_POST', '_COOKIE', '_FILES') as $v) {
            stripslashes_vars(${$v});
        }
    }
    define('SAFE_MODE', @ini_get('safe_mode') || @strtolower(ini_get('safe_mode')) == 'on' ? true : false);
} else {
    define('MAGIC_QUOTES_GPC', false);
    define('SAFE_MODE', false);
}
$_REQUEST = $_INPUT = hg_init_input();
$_configs = $gGlobalConfig;
$agent = strtolower($_SERVER['HTTP_USER_AGENT']);
$is_iphone = strpos($agent, 'iphone') ? true : false;
$is_ipad = strpos($agent, 'ipad') ? true : false;
$is_ipod = strpos($agent, 'ipod') ? true : false;
$is_android = strpos($agent, 'android') ? true : false;
define('ISIOS', $is_iphone || $is_ipad || $is_ipod);
define('ISANDROID', $is_android);
function m2o_web_addslashes($string)
{
    if (is_array($string)) {
        foreach ($string as $key => $val) {
            $string[$key] = m2o_web_addslashes($val);
        }
    } else {