3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the Revised BSD License.
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.
11 Copyright 2004-2023 iDB Support - https://idb.osdn.jp/support/category.php?act=view&id=1
12 Copyright 2004-2023 Game Maker 2k - https://idb.osdn.jp/support/category.php?act=view&id=2
13 Kill Register Globals (Register Globals are very lame we dont need them anyways. :P)
15 $FileInfo: killglobals.php - Last Update: 6/22/2023 SVN 984 - Author: cooldude2k $
17 $File3Name = basename($_SERVER['SCRIPT_NAME']);
18 if ($File3Name=="killqlobals.php"||
$File3Name=="/killqlobals.php") {
22 function unregister_globals() {
23 if (ini_get('register_globals')) {
28 if(isset($_SESSION)) {
29 $SESSION = $_SESSION; }
33 foreach($GLOBALS as $key => $value) {
35 unset($GLOBALS[$key]); } }
41 $_SESSION = $SESSION; }
44 $_SERVER = $SERVER; } }
47 unction unregister_globals() {
48 if (ini_get('register_globals')) {
49 foreach (array('_REQUEST', '_GET', '_POST', '_COOKIE', '_FILES', '_ENV', '_SERVER') as $superglobal) {
50 foreach ($GLOBALS[$superglobal] as $key => $value) {
51 unset($GLOBALS[$key]);
54 if (isset($_SESSION)) {
55 foreach ($_SESSION as $key => $value) {
56 unset($GLOBALS[$key]);
63 function unregister_globals_advanced() {
64 if (ini_get('register_globals')) {
65 $superglobals = array('_REQUEST', '_GET', '_POST', '_COOKIE', '_SESSION', '_FILES', '_ENV', '_SERVER');
66 foreach ($GLOBALS as $key => $value) {
67 if (!in_array($key, $superglobals) && $key != 'GLOBALS') {
68 unset($GLOBALS[$key]);
73 unregister_globals_advanced();