1
0
mirror of https://github.com/delight-im/PHP-Auth.git synced 2025-07-31 13:20:11 +02:00

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.
This commit is contained in:
Marco
2017-07-23 22:16:13 +02:00
parent 449e1c69ee
commit ad88c1c6ab

View File

@@ -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);