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

Create a library functions for handling paths in a microsoft safe way.

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.8
    • Fix Version/s: BACKEND
    • Component/s: Libraries
    • Labels:
    • Affected Branches:
      MOODLE_28_STABLE

      Description

      We currently have a lot of similar code for handling path strings that are from other operating systems (Windows). The current method is to do a string replace

      str_replace('\\', '/', $path);
      

      This code is used 56 times through the code, though a large amount of those are in third party files.
      Use the following for a complete list:
      grep -r "str_replace('\\\\\\\\', '/'"
      git grep will show you areas only in core moodle.

      It would be preferable if this was centralised in the one location.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                abgreeve Adrian Greeve
                Participants:
                Component watchers:
                Amaia Anabitarte, Bas Brands, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: