Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-7873

Warn about uses of DIRECTORY_SEPARATOR

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Deferred
    • Icon: Minor Minor
    • None
    • 3.6.6, 3.7
    • Local: Code checker
    • None
    • MOODLE_36_STABLE, MOODLE_37_STABLE

      Usually DIRECTORY_SEPARATOR is not needed at all.

      Only when PHP paths from conf/OS or comparisons with DIR are done we may need to normalize it to forward slashes .

      But all the handling within Moodle should be, exclusively, forward slashes. All OSs understand it. More specifically within Moodle APIs (file, caching...) it never should be used.

      https://dev.to/c33s/always-use--as-directory-seperator-in-php-43l7

      So a warning explaining the above whenever DIRECTORY_SEPARATOR uses are found... may be a good thing.

            moodle.com Moodle HQ
            stronk7 Eloy Lafuente (stronk7)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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