From e807dadb554d9d309bfb9be652c73d297fb5fbf0 Mon Sep 17 00:00:00 2001 From: Dan Poltawski Date: Fri, 31 May 2013 13:11:07 +0800 Subject: [PATCH] MDL-39968 bootstrapbase: uses non-standard browser sniffing Also theme_clean does the same sniffing, but is not necessary as its included by bootstrapbase --- theme/bootstrapbase/config.php | 6 +----- theme/clean/config.php | 8 -------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/theme/bootstrapbase/config.php b/theme/bootstrapbase/config.php index aba395fbbef..1c641a711b4 100644 --- a/theme/bootstrapbase/config.php +++ b/theme/bootstrapbase/config.php @@ -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'; } diff --git a/theme/clean/config.php b/theme/clean/config.php index 0517f379038..d13ea7446e1 100644 --- a/theme/clean/config.php +++ b/theme/clean/config.php @@ -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'; -}