]> git.mjollnir.org Git - moodle.git/commitdiff
Slightly better robustness for notice() when there is no referer
authormoodler <moodler>
Sun, 26 Jan 2003 06:04:14 +0000 (06:04 +0000)
committermoodler <moodler>
Sun, 26 Jan 2003 06:04:14 +0000 (06:04 +0000)
lib/weblib.php

index 93fef553654987cfcf9181dd5fc1c189ad65ae1e..90133297ada323b8848f81caf93ace8aea7316cc 100644 (file)
@@ -1111,10 +1111,14 @@ function helpbutton ($page, $title="", $module="moodle", $image=true, $linktext=
 }
 
 function notice ($message, $link="") {
-    global $THEME;
+    global $CFG, $THEME;
 
     if (!$link) {
-        $link = $_SERVER["HTTP_REFERER"];
+        if (!empty($_SERVER["HTTP_REFERER"])) {
+            $link = $_SERVER["HTTP_REFERER"];
+        } else {
+            $link = $CFG->wwwroot;
+        }
     }
 
     echo "<BR>";