From d9992bcaca47c240c85a547d24c501c1d4d5bbda Mon Sep 17 00:00:00 2001 From: mark_story Date: Sat, 30 Jan 2016 16:11:50 -0500 Subject: [PATCH] Use safer methods to read session configuration. Avoid potential undefined index warnings by using read() to safely fetch data. Refs #8101 --- lib/Cake/Model/Datasource/CakeSession.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Cake/Model/Datasource/CakeSession.php b/lib/Cake/Model/Datasource/CakeSession.php index b3b471686..6bde3e25a 100644 --- a/lib/Cake/Model/Datasource/CakeSession.php +++ b/lib/Cake/Model/Datasource/CakeSession.php @@ -345,12 +345,13 @@ class CakeSession { * @return bool */ protected static function _validAgentAndTime() { - $config = static::read('Config'); + $userAgent = static::read('Config.userAgent'); + $time = static::read('Config.time'); $validAgent = ( Configure::read('Session.checkAgent') === false || - isset($config['userAgent']) && static::$_userAgent === $config['userAgent'] + isset($userAgent) && static::$_userAgent === $userAgent ); - return ($validAgent && static::$time <= $config['time']); + return ($validAgent && static::$time <= $time); } /**