Merge 31db2412e21d4bab6aa6097d975acef7dc169202 into 4290ea753912378913b1f3f54e0fc5720afeda5d

This commit is contained in:
pandaninjas 2026-08-06 15:23:00 -07:00 committed by GitHub
commit ef827edf21
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -136,7 +136,7 @@ export function fromBase64(data, alphabet="A-Za-z0-9+/=", returnType="string", r
enc3 = alphabet.indexOf(data.charAt(i++) || null);
enc4 = alphabet.indexOf(data.charAt(i++) || null);
if (strictMode && (enc1 < 0 || enc2 < 0 || enc3 < 0 || enc4 < 0)) {
if (strictMode && (enc1 < 0 || enc2 < 0 || (enc3 < 0 && data.charAt(i - 2) !== "") ||(enc4 < 0 && data.charAt(i - 1) !== ""))) {
throw new OperationError("Error: Base64 input contains non-alphabet char(s)");
}