MDL-38016 Theme Bootstrap: Fix for unit tests undefined variable
authorDamyon Wiese <damyon@moodle.com>
Wed, 3 Apr 2013 02:58:23 +0000 (10:58 +0800)
committerDamyon Wiese <damyon@moodle.com>
Wed, 3 Apr 2013 02:58:23 +0000 (10:58 +0800)
theme/bootstrap/config.php

index 636fa2e..31c7d28 100644 (file)
@@ -159,7 +159,11 @@ $THEME->javascripts = array(
     'headercollapse',
 );
 
-if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 8') || strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7')) {
+$useragent = '';
+if (!empty($_SERVER['HTTP_USER_AGENT'])) {
+    $useragent = $_SERVER['HTTP_USER_AGENT'];
+}
+if (strpos($useragent, 'MSIE 8') || strpos($useragent, 'MSIE 7')) {
     $THEME->javascripts[] = 'html5shiv';
 }