fix: 修复str_pad方法并不会补充=号的小问题

This commit is contained in:
Jone Shen 2025-03-24 19:58:56 +08:00
parent 27ee1fa363
commit fa47993037

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), '='));
}
/**