From ad88c1c6abac18853747c147ea95660f963bf37f Mon Sep 17 00:00:00 2001 From: Marco Date: Sun, 23 Jul 2017 22:16:13 +0200 Subject: [PATCH] Use tilde character (~) instead of dot (.) for URL-safe Base64 coding The dot character is excluded from auto-linking in most email clients and is ambiguous in all other contexts when occurring at the end of a URL. The tilde character, being the only unreserved character for use in URLs that remains, as per RFC 3986, is thus a good alternative. --- src/Base64.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Base64.php b/src/Base64.php index 464d706..1ab4dde 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);