!727 修复isBase64判断不准确的问题

Merge pull request !727 from uyong/v5-dev
This commit is contained in:
Looly 2022-07-29 13:55:37 +00:00 committed by Gitee
commit f798b39dfa
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -352,6 +352,9 @@ public class Base64 {
* @since 5.7.5
*/
public static boolean isBase64(byte[] base64Bytes) {
if (base64Bytes == null || base64Bytes.length < 3) {
return false;
}
boolean hasPadding = false;
for (byte base64Byte : base64Bytes) {
if (hasPadding) {