diff --git a/apps/encryption/lib/session.php b/apps/encryption/lib/session.php index 785991ec2e..5e97391376 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 ea7ddf37a4..dbf3ecc45a 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; } /**