Skip to content

Commit

Permalink
Fixing Undefined index: Session
Browse files Browse the repository at this point in the history
  • Loading branch information
phpnut committed Dec 29, 2015
1 parent a1e140c commit bc005cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/Cake/Model/Datasource/Session/DatabaseSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ public function read($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'])) {
return '';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ public function testRead() {
$this->storage->write('bar', 0);
$this->assertEquals(0, $this->storage->read('bar'));
$this->assertSame('', $this->storage->read('made up value'));

}

/**
Expand Down

0 comments on commit bc005cd

Please sign in to comment.