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

Chat, Quiz and myMoodle will fail initializing if $CFG->wwwroot is empty

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.8.1
    • Fix Version/s: 1.7.5, 1.8.6
    • Component/s: Chat, Quiz
    • Labels:
      None
    • Environment:
      Apache 2.0, PHP 4.4, mySQL 5.1
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_17_STABLE, MOODLE_18_STABLE

      Description

      While you can run moodle with $CFG->wwwroot beeing empty, weblib will fail (in that case) setting $path in line 5625:

      $path = str_replace($CFG->httpswwwroot.'/', '', $CFG->pagepath);

      It will strip all slashes from $CFG->pagepath instead of kicking of $CFG->httpswwwroot.

      One of our customers couldn't get the chat- and quiz- modules running, so we detected wwwroot = '' in the config. Note: You get a whitescreen if you make php create an object with an empty name, that took us some time and efford to get the mouse trapped

      We couldn't reconstruct how this config was born, but it was there and moodle running.

      How to repeat:
      set wwwroot as emptystring, call chat-view.

      Suggested fix: check for all needed config every session_start(). Presenting an error message is better than a whitescreen.

      Regards,

      Christopher

        Attachments

          Activity

            People

            • Assignee:
              timhunt Tim Hunt
              Reporter:
              siefer Christoph Siefer
              Tester:
              Petr Skoda
              Participants:
              Component watchers:
              Jake Dallimore, Jun Pataleta, Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                11/Jul/08