From: moodler Date: Thu, 10 Jul 2008 08:50:43 +0000 (+0000) Subject: MDL-15601 Merged basic checking to avoid some notices X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=554606c76bc7497cb58cc33cf988fa22a6e3c6bd;p=moodle.git MDL-15601 Merged basic checking to avoid some notices --- diff --git a/course/lib.php b/course/lib.php index efdf443545..b4ca8e5c8f 100644 --- a/course/lib.php +++ b/course/lib.php @@ -1363,7 +1363,10 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false, print_spacer(12, 20 * $mod->indent, false); } - $extra = $modinfo->cms[$modnumber]->extra; + $extra = ''; + if (!empty($modinfo->cms[$modnumber]->extra)) { + $extra = $modinfo->cms[$modnumber]->extra; + } if ($mod->modname == "label") { if (!$mod->visible) { diff --git a/lib/weblib.php b/lib/weblib.php index c5df242fe6..fe732d4f9d 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -3366,7 +3366,11 @@ function check_theme_arrows() { // Also OK in Win 9x/2K/IE 5.x $THEME->rarrow = '►'; $THEME->larrow = '◄'; - $uagent = $_SERVER['HTTP_USER_AGENT']; + if (empty($_SERVER['HTTP_USER_AGENT'])) { + $uagent = ''; + } else { + $uagent = $_SERVER['HTTP_USER_AGENT']; + } if (false !== strpos($uagent, 'Opera') || false !== strpos($uagent, 'Mac')) { // Looks good in Win XP/Mac/Opera 8/9, Mac/Firefox 2, Camino, Safari.