BinaryDecode with Base64 ignored encoded string length

When I run below piece of code on latest version (at least on 5.3.8.201), its being Ignored the encoded string length and giving partial decoded strings. But the older version throws an error while decoding.

base_64 = ToBase64("I am a string."); binary_data = ToBinary(base_64); encoded_binary = BinaryEncode(binary_data, "base64"); writedump(encoded_binary); //SSBhbSBhIHN0cmluZy4= encoded_binary = 'SSBhbSBhIHN0cmluZy'; writedump(tostring(BinaryDecode(encoded_binary, "base64")));

This was a known issue in lucee.
https://luceeserver.atlassian.net/browse/LDEV-3034
https://luceeserver.atlassian.net/browse/LDEV-3818

And Already fixed from lucee 5.3.9.88-SNAPSHOT by adding a new argument precise to binaryDecode(). So please use precise = true in binaryDecode().

Note: there is a regression in encrypt function on the precise argument, the ticket is already in QA status [LDEV-4101] - Lucee.

2 Likes