mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Fixing Undefined index: Session
This commit is contained in:
parent
a1e140cbe0
commit
bc005cd014
2 changed files with 4 additions and 1 deletions
|
@ -92,6 +92,10 @@ class DatabaseSession implements CakeSessionHandlerInterface {
|
||||||
'conditions' => array($this->_model->alias . '.' . $this->_model->primaryKey => $id)
|
'conditions' => array($this->_model->alias . '.' . $this->_model->primaryKey => $id)
|
||||||
));
|
));
|
||||||
|
|
||||||
|
if(empty($row[$this->_model->alias])){
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
if (!is_numeric($row[$this->_model->alias]['data']) && empty($row[$this->_model->alias]['data'])) {
|
if (!is_numeric($row[$this->_model->alias]['data']) && empty($row[$this->_model->alias]['data'])) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,7 +147,6 @@ class DatabaseSessionTest extends CakeTestCase {
|
||||||
$this->storage->write('bar', 0);
|
$this->storage->write('bar', 0);
|
||||||
$this->assertEquals(0, $this->storage->read('bar'));
|
$this->assertEquals(0, $this->storage->read('bar'));
|
||||||
$this->assertSame('', $this->storage->read('made up value'));
|
$this->assertSame('', $this->storage->read('made up value'));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue