Merge pull request #11 from jonesshen/master

fix: 修复str_pad方法并不会补充=号的小问题
This commit is contained in:
邹景立 2025-03-31 23:02:50 +08:00 committed by GitHub
commit a24354ffec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -143,7 +143,7 @@ class CodeExtend
*/
public static function deSafe64(string $text): string
{
return base64_decode(str_pad(strtr($text, '-_', '+/'), strlen($text) % 4, '='));
return base64_decode(str_pad(strtr($text, '-_', '+/'), (int) (ceil(strlen($text) / 4) * 4), '='));
}
/**