summaryrefslogtreecommitdiffstats
path: root/src/JWT.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/JWT.php')
-rw-r--r--src/JWT.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/JWT.php b/src/JWT.php
index 814afc0..cb1ca7d 100644
--- a/src/JWT.php
+++ b/src/JWT.php
@@ -87,8 +87,9 @@ class JWT
if (null === $payload = static::jsonDecode(static::urlsafeB64Decode($bodyb64))) {
throw new UnexpectedValueException('Invalid claims encoding');
}
- $sig = static::urlsafeB64Decode($cryptob64);
-
+ if (false === ($sig = static::urlsafeB64Decode($cryptob64))) {
+ throw new UnexpectedValueException('Invalid signature encoding');
+ }
if (empty($header->alg)) {
throw new UnexpectedValueException('Empty algorithm');
}