Uploaded image for project: 'Lucee Development'
  1. LDEV-1803

toBase64 behaves differently with strings and numbers

    Details

    • Type: Bug
    • Status: Deployed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.2.6.60
    • Fix Version/s: 5.2.8.11
    • Labels:
      None
    • Environment:

      Windows & Linux

      Description

      I have noticed that the toBase64() function behaves differently between Lucee 5 and all other CF versions - that I have tested - Lucee4.5 , Railo and Adobe CF 10, 11 and 2016.

      It returns different values if a number is passed into it rather than a string. For eaxmple, paste the following into https://trycf.com/ :

      {{<cfscript>
      writeOutput(toBase64("251"));
      writeOutput("<br />");
      writeOutput(toBase64(251));
      </cfscript>}}

      Lucee 5 outputs:
      MjUx
      250=

      Everything else outputs:
      MjUx
      MjUx

      You can work around this by using toString to force the value to a string, but I guess that this should work in the same way as everything else?

        Attachments

          Activity

            People

            • Assignee:
              michael1 Michael Offner
              Reporter:
              Big Mart Martin Webb
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: