MDL-39968 bootstrapbase: uses non-standard browser sniffing
authorDan Poltawski <dan@moodle.com>
Fri, 31 May 2013 05:11:07 +0000 (13:11 +0800)
committerDan Poltawski <dan@moodle.com>
Fri, 31 May 2013 07:55:47 +0000 (15:55 +0800)
Also theme_clean does the same sniffing, but is not necessary as its
included by bootstrapbase

theme/bootstrapbase/config.php
theme/clean/config.php

index aba395f..1c641a7 100644 (file)
@@ -170,11 +170,7 @@ $THEME->javascripts_footer = array(
     'moodlebootstrap',
 );
 
-$useragent = '';
-if (!empty($_SERVER['HTTP_USER_AGENT'])) {
-    $useragent = $_SERVER['HTTP_USER_AGENT'];
-}
-if (strpos($useragent, 'MSIE 8') || strpos($useragent, 'MSIE 7')) {
+if (check_browser_version('MSIE') && !check_browser_version('MSIE', '9.0')) {
     $THEME->javascripts[] = 'html5shiv';
 }
 
index 0517f37..d13ea74 100644 (file)
@@ -55,11 +55,3 @@ $THEME->plugins_exclude_sheets = array(
 
 $THEME->rendererfactory = 'theme_overridden_renderer_factory';
 $THEME->csspostprocess = 'clean_process_css';
-
-$useragent = '';
-if (!empty($_SERVER['HTTP_USER_AGENT'])) {
-    $useragent = $_SERVER['HTTP_USER_AGENT'];
-}
-if (strpos($useragent, 'MSIE 8') || strpos($useragent, 'MSIE 7')) {
-    $THEME->javascripts[] = 'html5shiv';
-}