summaryrefslogtreecommitdiffstats
path: root/system/core/Input.php
diff options
context:
space:
mode:
authorPhil Sturgeon <email@philsturgeon.co.uk>2010-12-27 20:06:28 +0100
committerPhil Sturgeon <email@philsturgeon.co.uk>2010-12-27 20:06:28 +0100
commitc8089154217307a56b60ae8f0cb85087a1531b27 (patch)
tree18ea049c55438a80d9b3465863ff699063a12304 /system/core/Input.php
parent2280e8ea67f94e67f2c803e804fb1b8125b579b0 (diff)
parent5cbe4dd1f0d94791fe86e08111b77c1d57b83f54 (diff)
Implemented GET string support from Dan Horrigan and modified it slightly. Also tweaked his regex_match changes.
Diffstat (limited to 'system/core/Input.php')
-rw-r--r--system/core/Input.php19
1 files changed, 6 insertions, 13 deletions
diff --git a/system/core/Input.php b/system/core/Input.php
index 4ddc402ee..eb2048e58 100644
--- a/system/core/Input.php
+++ b/system/core/Input.php
@@ -49,9 +49,9 @@ class CI_Input {
{
log_message('debug', "Input Class Initialized");
- $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;
+ $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);
// Do we need to load the security class?
if ($this->_enable_xss == TRUE OR $this->_enable_csrf == TRUE)
@@ -216,14 +216,7 @@ class CI_Input {
}
else
{
- if ($expire > 0)
- {
- $expire = time() + $expire;
- }
- else
- {
- $expire = 0;
- }
+ $expire = ($expire > 0) ? time() + $expire : 0;
}
setcookie($prefix.$name, $value, $expire, $path, $domain, 0);
@@ -492,7 +485,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);
}
@@ -514,7 +507,7 @@ class CI_Input {
{
if (strpos($str, "\r") !== FALSE)
{
- $str = str_replace(array("\r\n", "\r"), "\n", $str);
+ $str = str_replace(array("\r\n", "\r"), PHP_EOL, $str);
}
}