Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-77152

file_storage::get_pathname_hash() does not check pathname for validity

XMLWordPrintable

    • 1
    • Team Hedgehog 2023 Sprint 2.1, Team Hedgehog 2023 Sprint 2.2

      When working on MDL-76309 I realized that file_storage::get_pathname_hash() does not check whether the $pathname parameter has a trailing / leading slash.

      As the entries in mdl_files always have a trailing slash in the pathname, get_pathname_hash() should ensure that to find the right files and to avoid collisions. This could happen when using pathinfo() PHP function which only returns the trailing slash in dirname when it's the root directory (in all other cases it is omitted).

       

            stefan.hanauska Stefan Hanauska
            stefan.hanauska Stefan Hanauska
            Meirza Meirza
            Andrew Lyons Andrew Lyons
            CiBoT CiBoT
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 46 minutes
                2h 46m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.