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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • 1.7.5, 1.8.6
    • 1.8.1
    • Chat, Quiz
    • None
    • Apache 2.0, PHP 4.4, mySQL 5.1
    • MySQL
    • MOODLE_18_STABLE
    • 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

            timhunt Tim Hunt
            siefer Christoph Siefer
            Petr Skoda Petr Skoda
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              11/Jul/08