XMLWordPrintable

Details

    • Sub-task
    • Resolution: Fixed
    • Minor
    • 2.0
    • 1.8.2
    • Installation
    • None
    • MOODLE_18_STABLE
    • MOODLE_20_STABLE

    Description

      The installer script doesn't tolerate symlinks when checking if $CFG->dirroot is valid.

      Lets say Moodle folder is on a separate volume, but symlinked in the DocumentRoot:
      /var/www/html/moodle -> /mnt/moodle/moodle_1.8.2
      Apache is set with DocumentRoot to /var/www/html/, and Moodle with $CFG->dirroot to /var/www/html/.

      In this instance, the following check during install will fail (/admin/index.php, line 79):
      $dirroot = dirname(realpath("../index.php"));
      if (!empty($dirroot) and $dirroot != $CFG->dirroot) {

      realpath() will retrieve the "real path" to the index.php, in this case /mnt/moodle/moodle_1.8.2, and comparison with
      /var/www/html will fail.

      I recommend a minor change to the code:
      $dirroot = dirname(realpath("../index.php"));
      $cfg_dirroot = dirname(realpath($CFG->dirroot . "/index.php"));
      if (!empty($dirroot) and $dirroot != $cfg_dirroot) {

      This will expand both paths to their physical paths, and compare /mnt/moodle/moodle_1.8.2==/mnt/moodle/moodle_1.8.2

      Attachments

        Issue Links

          Activity

            People

              skodak Petr Skoda (Inactive)
              jovca Slobodan Jovcic
              Nobody Nobody
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Clockify

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