From 39835a50277965f77322d5af30123100d2e1b694 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 11 Jan 2009 22:32:36 +0000 Subject: Update Kohana to r3890 --- kohana/libraries/Input.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'kohana/libraries/Input.php') 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 -- cgit v1.2.3