global.php
上传用户:gzy2002
上传日期:2010-02-11
资源大小:1785k
文件大小:3k
- <?php
- // +-------------------------------------------------------------+
- // | DeskPRO v [2.0.1 Production]
- // | Copyright (C) 2001 - 2004 Headstart Solutions Limited
- // | Supplied by WTN-WDYL
- // | Nullified by WTN-WDYL
- // | Distribution via WebForum, ForumRU and associated file dumps
- // +-------------------------------------------------------------+
- // | DESKPRO IS NOT FREE SOFTWARE
- // +-------------------------------------------------------------+
- // | License ID : Full Enterprise License =) ...
- // | License Owner : WTN-WDYL Team
- // +-------------------------------------------------------------+
- // | $RCSfile: global.php,v $
- // | $Date: 2004/02/10 01:34:25 $
- // | $Revision: 1.3 $
- // +-------------------------------------------------------------+
- // | File Details:
- // | - Global initialization.
- // +-------------------------------------------------------------+
- error_reporting(E_ALL ^ E_NOTICE);
- // standardise names
- if (!($_GET) and ($HTTP_GET_VARS)) {
- $_GET = &$HTTP_GET_VARS;
- }
- if (!($_POST) and ($HTTP_POST_VARS)) {
- $_POST = &$HTTP_POST_VARS;
- }
- if (!($_COOKIE) and ($HTTP_COOKIE_VARS)) {
- $_COOKIE = &$HTTP_COOKIE_VARS;
- }
- if (!($_SERVER) and ($HTTP_SERVER_VARS)) {
- $_SERVER = &$HTTP_SERVER_VARS;
- }
- if (!($_FILES) and ($HTTP_POST_FILES)) {
- $_FILES = &$HTTP_POST_FILES;
- }
- // create user input array
- if (!isset($_REQUEST)) {
- $_REQUEST = array_merge($_GET,$_POST,$_COOKIE);
- }
- ############################################################################
- // get rid of slashes in get / post / cookie data
- if (get_magic_quotes_gpc()) {
- function stripslashesarray($array) {
- if (is_array($array)) {
- foreach($array as $key => $val) {
- if (is_array($val)) {
- $array["$key"] = stripslashesarray($val);
- } elseif (is_string($val)) {
- if (get_cfg_var('magic_quotes_sybase')) {
- $array["$key"] = str_replace("''", "'", $val);
- } else {
- $array["$key"] = stripslashes($val);
- }
- }
- }
- }
- return $array;
- }
- $_GET = stripslashesarray($_GET);
- $_POST = stripslashesarray($_POST);
- $_COOKIE = stripslashesarray($_COOKIE);
- $_REQUEST = stripslashesarray($_REQUEST);
- }
- set_magic_quotes_runtime(0);
- ############################################################################
- // variables we do not to unset
- unset($parsevars);
- $parsevars = array(
- 'GLOBALS' => 1,
- '_GET' => 1,
- '_POST' => 1,
- '_COOKIE' => 1,
- '_REQUEST' => 1,
- '_SERVER' => 1,
- '_FILES' => 1,
- 'bench' => 1,
- 'showqueries' => 1,
- 'parsevars' => 1
- );
- // unset all other variables
- if (is_array($GLOBALS)) {
- foreach ($GLOBALS as $var => $key) {
- if ((!isset($parsevars[$var])) AND ($var != 'var') AND ($var != 'key')) {
- unset($GLOBALS[$var]);
- }
- }
- }
- unset($var, $parsevars, $key);