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

Bug with fileExists() with an Application mapping of /

    Details

    • Type: Bug
    • Status: Deployed
    • Priority: New
    • Resolution: Fixed
    • Affects Version/s: 4.5.1.022, 4.5.3.007
    • Fix Version/s: 5.0.0.236, 4.5.3.013
    • Labels:

      Description

      If you declare an application mapping of "/" the behavior of fileExists() doesn't work as expected. The issue appears to be in how allowRealPath argument works.

      I've attached a very simple use case that shows the problem.

      When the Application.cfc has the following line:

      this.mappings["/"] = getDirectoryFromPath(getCurrentTemplatePath());

      The behavior of fileExists() is different before the onRequest life cycle and after the life cycle starts.

      So, when this mapping exists, fileExists() will start returning false for files that do exist. You can use other file operations (i.e. fileRead()) without any issues.

      If the example code in the /www root doesn't work, you can use Brad Wood's vagrant project to spin it up:

      https://github.com/Ortus-Solutions/vagrant-centos-lucee

      Just unzip this folder to a sibling of the folder vagrant-centos-lucee folder (per the Vagrant instructions).

      Let me know if you have any questions. I have not tried this under Lucee 5 yet.

        Attachments

          Activity

            People

            • Assignee:
              michaeloffner Michael Offner
              Reporter:
              danswitzer2 Dan G. Switzer, II
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: