From: moodler Date: Sun, 26 Jan 2003 06:04:14 +0000 (+0000) Subject: Slightly better robustness for notice() when there is no referer X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=750ab759ed7e5f1062b2f62aac16003cf0603a46;p=moodle.git Slightly better robustness for notice() when there is no referer --- diff --git a/lib/weblib.php b/lib/weblib.php index 93fef55365..90133297ad 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -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 "
";