From bb2041dc4e5a121de9321fbf87846b7358d59d39 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Sat, 9 Jun 2007 00:16:13 +0000 Subject: --- system/libraries/Input.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'system/libraries/Input.php') diff --git a/system/libraries/Input.php b/system/libraries/Input.php index 63a6833d6..f113cff71 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -68,7 +68,8 @@ class CI_Input { */ function _sanitize_globals() { - // Unset globals. This is effectively the same as register_globals = off + // Unset globals for securiy. + // This is effectively the same as register_globals = off foreach (array($_GET, $_POST, $_COOKIE) as $global) { if ( ! is_array($global)) @@ -147,6 +148,13 @@ class CI_Input { return $new_array; } + // We strip slashes if magic quotes is on to keep things consistent + if (get_magic_quotes_gpc()) + { + $str = stripslashes($str); + } + + // Should we filter the input data? if ($this->use_xss_clean === TRUE) { $str = $this->xss_clean($str); @@ -175,12 +183,7 @@ class CI_Input { { exit('Disallowed Key Characters.'); } - - if ( ! get_magic_quotes_gpc()) - { - return addslashes($str); - } - + return $str; } -- cgit v1.2.3-24-g4f1b