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
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.8.1
    • 1.7.5, 1.8.6
    • 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
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona), Tim Hunt, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              11/Jul/08