diff options
author | Andrey Andreev <narf@devilix.net> | 2016-12-14 11:32:32 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2016-12-14 11:32:32 +0100 |
commit | 56d1efc5b14d7bd5a92800ba9394bf9201d48b61 (patch) | |
tree | f744fd4950bf437a6189a28c2d5d45cf0f6c58c7 /system | |
parent | 9be93ba78585e8256e25b3c4f43eed500d49d8e2 (diff) |
Move 'standardize_newlines' proc out of CI_Input::_clean_input_data()
Preparation for CI_Input::_sanitize_globals() removal.
Also, WTF?! I'm deprecating this functionality in 3.1.next.
Diffstat (limited to 'system')
-rw-r--r-- | system/core/Input.php | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/system/core/Input.php b/system/core/Input.php index 2e38e4501..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 */ @@ -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; } |