diff --git a/lib/Cake/Cache/Cache.php b/lib/Cake/Cache/Cache.php index aa00f542d..2cba7dadc 100644 --- a/lib/Cake/Cache/Cache.php +++ b/lib/Cake/Cache/Cache.php @@ -278,7 +278,7 @@ class Cache { * @return void */ public static function gc($config = 'default', $expires = null) { - return (bool)static::$_engines[$config]->gc($expires); + static::$_engines[$config]->gc($expires); } /** @@ -452,7 +452,7 @@ class Cache { $success = static::$_engines[$config]->delete($settings['prefix'] . $key); static::set(null, $config); - return (bool)$success; + return $success; } /** diff --git a/lib/Cake/Model/Datasource/CakeSession.php b/lib/Cake/Model/Datasource/CakeSession.php index fe601b4d3..b3b471686 100644 --- a/lib/Cake/Model/Datasource/CakeSession.php +++ b/lib/Cake/Model/Datasource/CakeSession.php @@ -143,7 +143,7 @@ class CakeSession { public static function init($base = null) { static::$time = time(); - if (env('HTTP_USER_AGENT') && !static::$_userAgent) { + if (env('HTTP_USER_AGENT')) { static::$_userAgent = md5(env('HTTP_USER_AGENT') . Configure::read('Security.salt')); } diff --git a/lib/Cake/Model/Datasource/Session/CacheSession.php b/lib/Cake/Model/Datasource/Session/CacheSession.php index d0540bcb7..793701992 100644 --- a/lib/Cake/Model/Datasource/Session/CacheSession.php +++ b/lib/Cake/Model/Datasource/Session/CacheSession.php @@ -83,7 +83,7 @@ class CacheSession implements CakeSessionHandlerInterface { * @return bool Success */ public function gc($expires = null) { - return (bool)Cache::gc(Configure::read('Session.handler.config'), $expires); + return Cache::gc(Configure::read('Session.handler.config'), $expires); } } diff --git a/lib/Cake/Model/Datasource/Session/DatabaseSession.php b/lib/Cake/Model/Datasource/Session/DatabaseSession.php index f5626808b..81cd708e8 100644 --- a/lib/Cake/Model/Datasource/Session/DatabaseSession.php +++ b/lib/Cake/Model/Datasource/Session/DatabaseSession.php @@ -123,9 +123,9 @@ class DatabaseSession implements CakeSessionHandlerInterface { 'counterCache' => false ); try { - return (bool)$this->_model->save($record, $options); + return $this->_model->save($record, $options); } catch (PDOException $e) { - return (bool)$this->_model->save($record, $options); + return $this->_model->save($record, $options); } } @@ -136,7 +136,7 @@ class DatabaseSession implements CakeSessionHandlerInterface { * @return bool True for successful delete, false otherwise. */ public function destroy($id) { - return (bool)$this->_model->delete($id); + return $this->_model->delete($id); } /** @@ -151,7 +151,7 @@ class DatabaseSession implements CakeSessionHandlerInterface { } else { $expires = time() - $expires; } - return (bool)$this->_model->deleteAll(array($this->_model->alias . ".expires <" => $expires), false, false); + return $this->_model->deleteAll(array($this->_model->alias . ".expires <" => $expires), false, false); } } diff --git a/lib/Cake/Test/test_app/Model/Datasource/Session/TestAppLibSession.php b/lib/Cake/Test/test_app/Model/Datasource/Session/TestAppLibSession.php index 4d509d3c4..2ba874dba 100644 --- a/lib/Cake/Test/test_app/Model/Datasource/Session/TestAppLibSession.php +++ b/lib/Cake/Test/test_app/Model/Datasource/Session/TestAppLibSession.php @@ -12,7 +12,6 @@ class TestAppLibSession implements CakeSessionHandlerInterface { } public function close() { - return true; } public function read($id) { @@ -22,12 +21,9 @@ class TestAppLibSession implements CakeSessionHandlerInterface { } public function destroy($id) { - return true; } public function gc($expires = null) { - return true; } - } diff --git a/lib/Cake/Test/test_app/Plugin/TestPlugin/Model/Datasource/Session/TestPluginSession.php b/lib/Cake/Test/test_app/Plugin/TestPlugin/Model/Datasource/Session/TestPluginSession.php index 92a2817a1..acad188e0 100644 --- a/lib/Cake/Test/test_app/Plugin/TestPlugin/Model/Datasource/Session/TestPluginSession.php +++ b/lib/Cake/Test/test_app/Plugin/TestPlugin/Model/Datasource/Session/TestPluginSession.php @@ -12,7 +12,6 @@ class TestPluginSession implements CakeSessionHandlerInterface { } public function close() { - return true; } public function read($id) { @@ -22,11 +21,9 @@ class TestPluginSession implements CakeSessionHandlerInterface { } public function destroy($id) { - return true; } public function gc($expires = null) { - return true; } }