summaryrefslogtreecommitdiff
path: root/kohana/libraries/Input.php
diff options
context:
space:
mode:
Diffstat (limited to 'kohana/libraries/Input.php')
-rw-r--r--kohana/libraries/Input.php15
1 files changed, 6 insertions, 9 deletions
diff --git a/kohana/libraries/Input.php b/kohana/libraries/Input.php
index a0004621..3cdef0b8 100644
--- a/kohana/libraries/Input.php
+++ b/kohana/libraries/Input.php
@@ -83,16 +83,13 @@ class Input_Core {
$preserve = array('GLOBALS', '_REQUEST', '_GET', '_POST', '_FILES', '_COOKIE', '_SERVER', '_ENV', '_SESSION');
// This loop has the same effect as disabling register_globals
- foreach ($GLOBALS as $key => $val)
+ foreach (array_diff(array_keys($GLOBALS), $preserve) as $key)
{
- if ( ! in_array($key, $preserve))
- {
- global $$key;
- $$key = NULL;
-
- // Unset the global variable
- unset($GLOBALS[$key], $$key);
- }
+ global $$key;
+ $$key = NULL;
+
+ // Unset the global variable
+ unset($GLOBALS[$key], $$key);
}
// Warn the developer about register globals