Fixing Undefined index: Session

This commit is contained in:
Larry E. Masters 2015-12-28 23:32:18 -05:00
parent a1e140cbe0
commit bc005cd014
2 changed files with 4 additions and 1 deletions

View file

@ -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 '';
} }

View file

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