Uploaded image for project: 'Railo'
  1. Railo
  2. RAILO-2228

listToArray() incompat with ColdFusion

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: 4.0.2.002
    • Fix Version/s: 4.1.0.002, 4.0.3.002
    • Labels:
      None
    • Environment:

      Windows 7 64-bit, running the JRE-less version of Railo express, using a 64-bit JDK v 1.7.0_07

    • Steps to Reproduce:
      Hide

      <cfscript>
      chars = "abcde";
      array = listToArray(chars, "");
      writeDump(variables);
      </cfscript>

      Show
      <cfscript> chars = "abcde"; array = listToArray(chars, ""); writeDump(variables); </cfscript>

      Description

      See steps to reproduce.

      On ColdFusion, this yields a five-element array with each character as an element. On Railo it's just a single-element array with the whole string in the first element.

      ColdFusion's behaviour dates back to at least CFMX7 (that's the oldest version I have on tap).

      There is no suggestion one way or the other in the ColdFusion docs (http://help.adobe.com/en_US/ColdFusion/10.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7f0f.html) whether an empty string should be allowable as a delimiter like this, but CF has worked this way since before Railo existed, so that's perhaps an adequate precedent? I could see arguments either way, but if a zero-length delimiter is illegal, then this should perhaps raise an exception. If it's valid, it should work the same as ColdFusion does, I think?

      Cheers.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                micstriit Michael Offner
                Reporter:
                adamcameroncf Adam Cameron
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: