Merge pull request #4850 from ADmad/issue-4849

Make CakeSession::read() return null for all failure cases.
This commit is contained in:
Mark Story 2014-10-09 13:08:25 -04:00
commit 84eb151dd1
2 changed files with 2 additions and 2 deletions

View file

@ -378,7 +378,7 @@ class CakeSession {
*/ */
public static function read($name = null) { public static function read($name = null) {
if (empty($name) && $name !== null) { if (empty($name) && $name !== null) {
return false; return null;
} }
if (!self::_hasSession() || !self::start()) { if (!self::_hasSession() || !self::start()) {
return null; return null;

View file

@ -280,7 +280,7 @@ class CakeSessionTest extends CakeTestCase {
* @return void * @return void
*/ */
public function testReadyEmpty() { public function testReadyEmpty() {
$this->assertFalse(TestCakeSession::read('')); $this->assertNull(TestCakeSession::read(''));
} }
/** /**