summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-03-06 10:16:57 +0100
committerAndrey Andreev <narf@bofh.bg>2012-03-06 10:16:57 +0100
commit6b83123dce4a78e06f6eedc7cb1b2bb78d2294f0 (patch)
tree683ba86ed03ea684bcc501fc724b2a7de56782eb /system
parent9c68c3173c84041b1ee77929e540a4a4382edeee (diff)
Fixed a bug in CI_Session::_unserialize()
Diffstat (limited to 'system')
-rw-r--r--system/libraries/Session.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/system/libraries/Session.php b/system/libraries/Session.php
index dd50a91e1..104b88810 100644
--- a/system/libraries/Session.php
+++ b/system/libraries/Session.php
@@ -454,7 +454,7 @@ class CI_Session {
*/
public function userdata($item)
{
- return ( ! isset($this->userdata[$item])) ? FALSE : $this->userdata[$item];
+ return isset($this->userdata[$item]) ? $this->userdata[$item] : FALSE;
}
// --------------------------------------------------------------------
@@ -729,7 +729,7 @@ class CI_Session {
*/
protected function _unserialize($data)
{
- $data = @unserialize(strip_slashes($data));
+ $data = @unserialize(strip_slashes(trim($data)));
if (is_array($data))
{
@@ -737,9 +737,11 @@ class CI_Session {
return $data;
}
- return (is_string($data)) ? str_replace('{{slash}}', '\\', $data) : $data;
+ return is_string($data) ? str_replace('{{slash}}', '\\', $data) : $data;
}
+ // --------------------------------------------------------------------
+
/**
* Unescape slashes
*
@@ -779,7 +781,7 @@ class CI_Session {
{
$expire = $this->now - $this->sess_expiration;
- $this->CI->db->where("last_activity < {$expire}");
+ $this->CI->db->where('last_activity < '.$expire);
$this->CI->db->delete($this->sess_table_name);
log_message('debug', 'Session garbage collection performed.');