mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Use safer methods to read session configuration.
Avoid potential undefined index warnings by using read() to safely fetch data. Refs #8101
This commit is contained in:
parent
fc57dee72f
commit
d9992bcaca
1 changed files with 4 additions and 3 deletions
|
@ -345,12 +345,13 @@ class CakeSession {
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
protected static function _validAgentAndTime() {
|
protected static function _validAgentAndTime() {
|
||||||
$config = static::read('Config');
|
$userAgent = static::read('Config.userAgent');
|
||||||
|
$time = static::read('Config.time');
|
||||||
$validAgent = (
|
$validAgent = (
|
||||||
Configure::read('Session.checkAgent') === false ||
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue