From fd6948997faf5f064f76353da65bd1d0ec65ec51 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Wed, 15 Dec 2010 10:52:37 +0000 Subject: Potential PHP 5.4 issue, get_magic_quotes_gpc() is being removed. This change will check the function exists before calling it in Input. --- system/core/Input.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/Input.php') diff --git a/system/core/Input.php b/system/core/Input.php index 9d8811cdd..5a227332c 100644 --- a/system/core/Input.php +++ b/system/core/Input.php @@ -492,7 +492,7 @@ class CI_Input { } // We strip slashes if magic quotes is on to keep things consistent - if (get_magic_quotes_gpc()) + if (function_exists('get_magic_quotes_gpc') AND get_magic_quotes_gpc()) { $str = stripslashes($str); } -- cgit v1.2.3-24-g4f1b From 65d603e03d3befd6e4f13361c78ab454ea57ba70 Mon Sep 17 00:00:00 2001 From: Dan Horrigan Date: Wed, 15 Dec 2010 08:38:30 -0500 Subject: Added full Query String and $_GET array support. This is enabled by default. Added a seperate config option to enable/disable the $_GET array. --- system/core/Input.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/core/Input.php') diff --git a/system/core/Input.php b/system/core/Input.php index 9d8811cdd..4ddc402ee 100644 --- a/system/core/Input.php +++ b/system/core/Input.php @@ -30,7 +30,7 @@ class CI_Input { var $ip_address = FALSE; var $user_agent = FALSE; - var $_allow_get_array = FALSE; + var $_allow_get_array = TRUE; var $_standardize_newlines = TRUE; var $_enable_xss = FALSE; // Set automatically based on config setting var $_enable_csrf = FALSE; // Set automatically based on config setting @@ -49,7 +49,7 @@ class CI_Input { { log_message('debug', "Input Class Initialized"); - $this->_allow_get_array = (config_item('enable_query_strings') === TRUE) ? TRUE : FALSE; + $this->_allow_get_array = (config_item('allow_get_array') === TRUE) ? TRUE : FALSE; $this->_enable_xss = (config_item('global_xss_filtering') === TRUE) ? TRUE : FALSE; $this->_enable_csrf = (config_item('csrf_protection') === TRUE) ? TRUE : FALSE; -- cgit v1.2.3-24-g4f1b From c3828718925a0f1660cddadc95b63e14f7189faa Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Wed, 19 Jan 2011 12:31:47 +0000 Subject: Reverted regex validation while we re-think the implementation, and added ->input->is_cli_request(); --- system/core/Input.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'system/core/Input.php') diff --git a/system/core/Input.php b/system/core/Input.php index eb2048e58..3a52e37aa 100644 --- a/system/core/Input.php +++ b/system/core/Input.php @@ -618,19 +618,33 @@ class CI_Input { } // -------------------------------------------------------------------- - + /** * Is ajax Request? * * Test to see if a request contains the HTTP_X_REQUESTED_WITH header * - * @return boolean + * @return boolean */ public function is_ajax_request() { return ($this->server('HTTP_X_REQUESTED_WITH') === 'XMLHttpRequest'); } + // -------------------------------------------------------------------- + + /** + * Is cli Request? + * + * Test to see if a request was made from the command line + * + * @return boolean + */ + public function is_cli_request() + { + return (bool) defined('STDIN'); + } + } // END Input class -- cgit v1.2.3-24-g4f1b