Merge pull request #8141 from cakephp/session-index-error

Use safer methods to read session configuration.
This commit is contained in:
Mark Story 2016-02-01 21:52:23 -05:00
commit 3a51018792

View file

@ -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);
}
/**