OSDN Git Service

30cad4a9ede3d07e9653c940d1a1de690996de01
[idb/iDB-Extras.git.git] / vercheck / inc / killglobals.php
1 <?php
2 /*
3     This program is free software; you can redistribute it and/or modify
4     it under the terms of the Revised BSD License.
5
6     This program is distributed in the hope that it will be useful,
7     but WITHOUT ANY WARRANTY; without even the implied warranty of
8     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
9     Revised BSD License for more details.
10
11     Copyright 2009-2010 iDB Support - http://idb.berlios.de/
12     Copyright 2009-2010 Game Maker 2k - http://gamemaker2k.org/
13         Kill Register Globals (Register Globals are very lame we dont need them anyways. :P)
14
15     $FileInfo: index.php - Last Update: 4/27/2009 Ver 2.5 - Author: cooldude2k $
16 */
17 $File3Name = basename($_SERVER['SCRIPT_NAME']);
18 if ($File3Name=="killqlobals.php"||$File3Name=="/killqlobals.php") {
19         require('index.php');
20         exit(); }
21 function unregister_globals() {
22    $REQUEST = $_REQUEST;
23    $GET = $_GET;
24    $POST = $_POST;
25    $COOKIE = $_COOKIE;
26    if(isset($_SESSION)) {
27    $SESSION = $_SESSION; }
28    $FILES = $_FILES;
29    $ENV = $_ENV;
30    $SERVER = $_SERVER;
31    foreach($GLOBALS as $key => $value) {
32    if($key!='GLOBALS') {
33    unset($GLOBALS[$key]); } }
34    $_REQUEST = $REQUEST;
35    $_GET = $GET;
36    $_POST = $POST;
37    $_COOKIE = $COOKIE;
38    if(isset($SESSION)) {
39    $_SESSION = $SESSION; }
40    $_FILES = $FILES;
41    $_ENV = $ENV;
42    $_SERVER = $SERVER; }
43 unregister_globals();
44 ?>