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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user