diff options
author | Mike Funk <mfunk@xulonpress.com> | 2012-03-07 19:29:37 +0100 |
---|---|---|
committer | Mike Funk <mfunk@xulonpress.com> | 2012-03-07 19:29:37 +0100 |
commit | 1909b5b1dd5e2d6847cbe4a87a0aadd52b506681 (patch) | |
tree | 8aaf0c86aa49dc0bacd55daeb2144d40c37ae8e0 /system/libraries/Session.php | |
parent | a90b1f2f89a41b2fe061f5fdd3f84f08b961a887 (diff) | |
parent | 1d571971be8be78a92d31aad27dda4009770043f (diff) |
merged from develop, fixed conflict in user guide.
Diffstat (limited to 'system/libraries/Session.php')
-rw-r--r-- | system/libraries/Session.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/system/libraries/Session.php b/system/libraries/Session.php index 66b39a6a2..104b88810 100644 --- a/system/libraries/Session.php +++ b/system/libraries/Session.php @@ -219,7 +219,7 @@ class CI_Session { $this->CI->db->where('user_agent', $session['user_agent']); } - $query = $this->CI->db->get($this->sess_table_name); + $query = $this->CI->db->limit(1)->get($this->sess_table_name); // No result? Kill it! if ($query->num_rows() === 0) @@ -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.'); |