From: Clark Tomlinson Date: Tue, 31 Mar 2015 16:21:30 +0000 (-0400) Subject: fixing test helper and undoing fubar in class... X-Git-Tag: v8.1.0alpha1~78^2~61 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ea6b53042d8464792c5ce7545d618f90128c914d;p=nextcloud-server.git fixing test helper and undoing fubar in class... --- diff --git a/apps/encryption/lib/session.php b/apps/encryption/lib/session.php index 785991ec2e0..5e973913769 100644 --- a/apps/encryption/lib/session.php +++ b/apps/encryption/lib/session.php @@ -54,7 +54,7 @@ class Session { */ public function getStatus() { $status = $this->session->get('encryptionInitialized'); - if (!$status) { + if (is_null($status)) { $status = self::NOT_INITIALIZED; } @@ -69,8 +69,7 @@ class Session { */ public function getPrivateKey() { $key = $this->session->get('privateKey'); - - if (!$key) { + if (is_null($key)) { throw new Exceptions\PrivateKeyMissingException('no private key stored in session'); } return $key; @@ -83,7 +82,7 @@ class Session { */ public function isPrivateKeySet() { $key = $this->session->get('privateKey'); - if (!$key) { + if (is_null($key)) { return false; } diff --git a/apps/encryption/tests/lib/SessionTest.php b/apps/encryption/tests/lib/SessionTest.php index ea7ddf37a4b..dbf3ecc45a1 100644 --- a/apps/encryption/tests/lib/SessionTest.php +++ b/apps/encryption/tests/lib/SessionTest.php @@ -104,7 +104,7 @@ class SessionTest extends TestCase { if (!empty(self::$tempStorage[$key])) { return self::$tempStorage[$key]; } - return false; + return null; } /**