From 854bc2b62bc4bb33ba051358fc29e7b7cee1cb00 Mon Sep 17 00:00:00 2001 From: Marco Date: Sun, 23 Jul 2017 23:18:28 +0200 Subject: [PATCH] Swap positions of hyphen and underscore characters in URL-safe Base64 This ensures compatibility with RFC 4648 and the example from the appendix of RFC 7515, aside from the padding character that is used. --- src/Base64.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Base64.php b/src/Base64.php index 7abce3d..a90a825 100644 --- a/src/Base64.php +++ b/src/Base64.php @@ -11,7 +11,7 @@ namespace Delight\Auth; final class Base64 { const SPECIAL_CHARS_ORIGINAL = '+/='; - const SPECIAL_CHARS_SAFE = '_-~'; + const SPECIAL_CHARS_SAFE = '-_~'; public static function encode($data, $safeChars = false) { $result = base64_encode($data);