Make CakeSession::read() return null for all failure cases.

This commit is contained in:
ADmad 2014-10-09 19:19:53 +05:30
parent d16a63894e
commit 94e718372a
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(''));
} }
/** /**