From e4f5e046f69ed3a21765067d4f5fe9fd4a693477 Mon Sep 17 00:00:00 2001 From: Andrew Date: Tue, 11 Aug 2026 09:27:08 -0400 Subject: [PATCH] Update src/Data/Payload.php simplify the fix for the decoding, while still resolving the issue. --- src/Data/Payload.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Data/Payload.php b/src/Data/Payload.php index ede6f7f..6d232a1 100644 --- a/src/Data/Payload.php +++ b/src/Data/Payload.php @@ -19,9 +19,9 @@ final class Payload public static function decode(string $base64url): ?Payload { /* convert the base64url into json string */ - $base64 = strtr($base64url, '-_', '+/'); - $base64 .= str_repeat('=', (4 - strlen($base64) % 4) % 4); - $json = base64_decode($base64, true); + $json = base64_decode(str_pad(strtr($base64url, '-_', '+/'), + strlen($base64url) + strlen($base64url) % 4, '=' + ), true); if ($json) { /* convert the json string into real data */ $data = json_decode($json);