From bd0b4b306fd9995e19c333eb9b55806e9b56f34c Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 2 Jul 2012 15:48:35 +0300 Subject: Fix issue #1543 --- system/libraries/Cache/drivers/Cache_file.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'system/libraries') diff --git a/system/libraries/Cache/drivers/Cache_file.php b/system/libraries/Cache/drivers/Cache_file.php index c50043660..e515eebf1 100644 --- a/system/libraries/Cache/drivers/Cache_file.php +++ b/system/libraries/Cache/drivers/Cache_file.php @@ -151,13 +151,12 @@ class CI_Cache_file extends CI_Driver { { return FALSE; } - - $data = read_file($this->_cache_path.$id); + + $data = read_file($this->_cache_path.$id); $data = unserialize($data); - + if (is_array($data)) { - $data = $data['data']; $mtime = filemtime($this->_cache_path.$id); if ( ! isset($data['ttl'])) @@ -166,11 +165,11 @@ class CI_Cache_file extends CI_Driver { } return array( - 'expire' => $mtime + $data['ttl'], + 'expire' => $mtime + $data['ttl'], 'mtime' => $mtime ); } - + return FALSE; } -- cgit v1.2.3-24-g4f1b From aa6868d9b9664553066cce908211030693774273 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 18 Jul 2012 16:02:40 +0300 Subject: Backport fix for issue #1314 --- system/libraries/Session.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'system/libraries') diff --git a/system/libraries/Session.php b/system/libraries/Session.php index 8ee08c5b2..891fdd36a 100644 --- a/system/libraries/Session.php +++ b/system/libraries/Session.php @@ -97,7 +97,7 @@ class CI_Session { { $this->sess_expiration = (60*60*24*365*2); } - + // Set the cookie name $this->sess_cookie_name = $this->cookie_prefix.$this->sess_cookie_name; @@ -399,7 +399,7 @@ class CI_Session { function sess_destroy() { // Kill the session DB row - if ($this->sess_use_database === TRUE AND isset($this->userdata['session_id'])) + if ($this->sess_use_database === TRUE && isset($this->userdata['session_id'])) { $this->CI->db->where('session_id', $this->userdata['session_id']); $this->CI->db->delete($this->sess_table_name); @@ -414,6 +414,9 @@ class CI_Session { $this->cookie_domain, 0 ); + + // Kill session data + $this->userdata = array(); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b From 38339acb3de57283a63a72b2febe43fef9411453 Mon Sep 17 00:00:00 2001 From: Raul Baldner junior Date: Tue, 31 Jul 2012 15:59:10 -0300 Subject: Fix warning by profiler when userdata has objects If session data has objects and profiler is enabled, a warning is trown: > A PHP Error was encountered > Severity: Warning > Message: htmlspecialchars() expects parameter 1 to be string, object given > Filename: libraries/Profiler.php > Line Number: 514 --- system/libraries/Profiler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 082a5ee1d..0e0bde97f 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -506,7 +506,7 @@ class CI_Profiler { foreach ($this->CI->session->all_userdata() as $key => $val) { - if (is_array($val)) + if (is_array($val) || is_object($val)) { $val = print_r($val, TRUE); } -- cgit v1.2.3-24-g4f1b From 894b7433cdab3ccb1577f2696a31d7b7a9ebb20d Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 1 Aug 2012 16:09:35 +0300 Subject: Style fix and changelog entry for pull #1675 --- system/libraries/Profiler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 0e0bde97f..882a82c1f 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -506,7 +506,7 @@ class CI_Profiler { foreach ($this->CI->session->all_userdata() as $key => $val) { - if (is_array($val) || is_object($val)) + if (is_array($val) OR is_object($val)) { $val = print_r($val, TRUE); } -- cgit v1.2.3-24-g4f1b From 7ad72975fa3cda4bf8797f788ba7445bdb4ae67a Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 4 Oct 2012 15:16:41 +0300 Subject: Backport fix for issue #1699 --- system/libraries/Migration.php | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) (limited to 'system/libraries') diff --git a/system/libraries/Migration.php b/system/libraries/Migration.php index 5a41377ea..df2dd7ce3 100644 --- a/system/libraries/Migration.php +++ b/system/libraries/Migration.php @@ -57,7 +57,7 @@ class CI_Migration { } // If not set, set it - $this->_migration_path == '' OR $this->_migration_path = APPPATH . 'migrations/'; + $this->_migration_path == '' AND $this->_migration_path = APPPATH . 'migrations/'; // Add trailing slash if not set $this->_migration_path = rtrim($this->_migration_path, '/').'/'; @@ -89,8 +89,7 @@ class CI_Migration { * Calls each migration step required to get to the schema version of * choice * - * @access public - * @param $version integer Target schema version + * @param int Target schema version * @return mixed TRUE if already latest, FALSE if failed, int if upgraded */ public function version($target_version) @@ -105,14 +104,13 @@ class CI_Migration { ++$stop; $step = 1; } - else { // Moving Down $step = -1; } - - $method = $step === 1 ? 'up' : 'down'; + + $method = ($step === 1) ? 'up' : 'down'; $migrations = array(); // We now prepare to actually DO the migrations @@ -216,7 +214,6 @@ class CI_Migration { /** * Set's the schema to the latest migration * - * @access public * @return mixed true if already latest, false if failed, int if upgraded */ public function latest() @@ -228,7 +225,7 @@ class CI_Migration { } $last_migration = basename(end($migrations)); - + // Calculate the last migration step from existing migration // filenames and procceed to the standard version migration return $this->version((int) substr($last_migration, 0, 3)); @@ -239,7 +236,6 @@ class CI_Migration { /** * Set's the schema to the migration version set in config * - * @access public * @return mixed true if already current, false if failed, int if upgraded */ public function current() @@ -252,7 +248,6 @@ class CI_Migration { /** * Error string * - * @access public * @return string Error message returned as a string */ public function error_string() @@ -265,7 +260,6 @@ class CI_Migration { /** * Set's the schema to the latest migration * - * @access protected * @return mixed true if already latest, false if failed, int if upgraded */ protected function find_migrations() @@ -273,7 +267,7 @@ class CI_Migration { // Load all *_*.php files in the migrations path $files = glob($this->_migration_path . '*_*.php'); $file_count = count($files); - + for ($i = 0; $i < $file_count; $i++) { // Mark wrongly formatted files as false for later filtering @@ -283,9 +277,8 @@ class CI_Migration { $files[$i] = FALSE; } } - - sort($files); + sort($files); return $files; } @@ -294,8 +287,7 @@ class CI_Migration { /** * Retrieves current schema version * - * @access protected - * @return integer Current Migration + * @return int Current Migration */ protected function _get_version() { @@ -308,9 +300,8 @@ class CI_Migration { /** * Stores the current schema version * - * @access protected - * @param $migrations integer Migration reached - * @return void Outputs a report of the migration + * @param int Migration reached + * @return bool */ protected function _update_version($migrations) { @@ -324,8 +315,7 @@ class CI_Migration { /** * Enable the use of CI super-global * - * @access public - * @param $var + * @param mixed $var * @return mixed */ public function __get($var) -- cgit v1.2.3-24-g4f1b