diff options
Diffstat (limited to 'lib/crypt.php')
-rw-r--r-- | lib/crypt.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/crypt.php b/lib/crypt.php index 14222d2..a83a723 100644 --- a/lib/crypt.php +++ b/lib/crypt.php @@ -71,8 +71,9 @@ class Crypt { */ public function ReadHash($hash) { $result = NULL; + $error = NULL; if ($hash === NULL) { - return $result; + return [$result, "hash is empty"]; } try { $payload = base64_decode($hash); @@ -82,10 +83,13 @@ class Crypt { if ($payloadParts[0] === $encode) { $result = json_decode($payloadParts[1]); + } else { + $error = "hash not equal"; } } catch (\Exception $e) { + $error = $e->getMessage(); } - return $result; + return [$result, $error]; } /** |