summaryrefslogtreecommitdiffstats
path: root/system/libraries/Session.php
diff options
context:
space:
mode:
authorMike Funk <mfunk@xulonpress.com>2012-03-07 19:33:27 +0100
committerMike Funk <mfunk@xulonpress.com>2012-03-07 19:33:27 +0100
commit9fcb2ad0e435fdfeda5b147b3fee112b4cb89861 (patch)
treebbaa310e66f1b6463a498737658674cf1c0322ae /system/libraries/Session.php
parentaa20f5b70f6da196d1a66d5dc17b05a037708e1a (diff)
parent1d571971be8be78a92d31aad27dda4009770043f (diff)
merged latest develop branch, fixed changelog conflict.
Diffstat (limited to 'system/libraries/Session.php')
-rw-r--r--system/libraries/Session.php12
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.');