summaryrefslogtreecommitdiffstats
path: root/system/core/Input.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/core/Input.php')
-rw-r--r--system/core/Input.php41
1 files changed, 8 insertions, 33 deletions
diff --git a/system/core/Input.php b/system/core/Input.php
index 24fe8a9cc..ec57cd448 100644
--- a/system/core/Input.php
+++ b/system/core/Input.php
@@ -67,15 +67,6 @@ class CI_Input {
protected $_allow_get_array = TRUE;
/**
- * Standardize new lines flag
- *
- * If set to TRUE, then newlines are standardized.
- *
- * @var bool
- */
- protected $_standardize_newlines;
-
- /**
* Enable XSS flag
*
* Determines whether the XSS filter is always active when
@@ -140,7 +131,6 @@ class CI_Input {
$this->_allow_get_array = (config_item('allow_get_array') === TRUE);
$this->_enable_xss = (config_item('global_xss_filtering') === TRUE);
$this->_enable_csrf = (config_item('csrf_protection') === TRUE);
- $this->_standardize_newlines = (bool) config_item('standardize_newlines');
$this->security =& load_class('Security', 'core');
@@ -159,6 +149,13 @@ class CI_Input {
$this->security->csrf_verify();
}
+ if ( ! empty($_POST) && config_item('standardize_newlines') === TRUE)
+ {
+ array_walk_recursive($_POST, function(&$value) {
+ $value = preg_replace('/(?:\r\n|[\r\n])/', PHP_EOL, $value);
+ });
+ }
+
log_message('info', 'Input Class Initialized');
}
@@ -595,7 +592,6 @@ class CI_Input {
*
* - Unsets $_GET data, if query strings are not enabled
* - Cleans POST, COOKIE and SERVER data
- * - Standardizes newline characters to PHP_EOL
*
* @return void
*/
@@ -653,7 +649,7 @@ class CI_Input {
// Sanitize PHP_SELF
$_SERVER['PHP_SELF'] = strip_tags($_SERVER['PHP_SELF']);
- log_message('debug', 'Global POST, GET and COOKIE data sanitized');
+ log_message('info', 'Global POST, GET and COOKIE data sanitized');
}
// --------------------------------------------------------------------
@@ -698,12 +694,6 @@ class CI_Input {
// Remove control characters
$str = remove_invisible_characters($str, FALSE);
- // Standardize newlines if needed
- if ($this->_standardize_newlines === TRUE)
- {
- return preg_replace('/(?:\r\n|[\r\n])/', PHP_EOL, $str);
- }
-
return $str;
}
@@ -841,21 +831,6 @@ class CI_Input {
// --------------------------------------------------------------------
/**
- * Is CLI request?
- *
- * Test to see if a request was made from the command line.
- *
- * @deprecated 3.0.0 Use is_cli() instead
- * @return bool
- */
- public function is_cli_request()
- {
- return is_cli();
- }
-
- // --------------------------------------------------------------------
-
- /**
* Get Request Method
*
* Return the request method