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

String member function breaks a lot of existing FW/1 installations

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 4.2.0.009
    • Fix Version/s: 4.3.0.000, 4.2.1.000
    • Labels:
      None

      Description

      FW/1 examples have historically used the Java String .replace() method to strip the context root out of the CGI script name to dynamically create a root folder for the app:
      variables.root = getDirectoryFromPath( CGI.SCRIPT_NAME ).replace( getContextRoot(), '' );
      In most installations, getContextRoot() returns an empty string but Java's happy with that. Now that Railo has added string member functions, this is broken because the BIF replace() does not accept an empty string as the second argument:
      replace("string","","new")
      Adobe broke this code in the exact same way but have agreed this is a bug and will fix it:

      https://bugbase.adobe.com/index.cfm?event=bug&id=3753710

      I think Railo should also fix this (partly because it'll break a lot of existing FW/1 apps and partly because the BIF not accepting an empty string is a bit silly when the underlying Java String replace will accept it).

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                micstriit Michael Offner
                Reporter:
                seancorfield Sean Corfield
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: