MDL-43082 Themes IE 9 Compatibility View doesn't support SVG.
This commit is contained in:
@@ -1145,6 +1145,11 @@ class theme_config {
|
||||
} else if (check_browser_version('MSIE', 0) and !check_browser_version('MSIE', 9)) {
|
||||
// IE < 9 doesn't support SVG. Say no.
|
||||
$this->usesvg = false;
|
||||
} else if (check_browser_version('MSIE', 0) and !check_browser_version('MSIE', 10) and
|
||||
// IE running in Compatibility View?
|
||||
(preg_match("/MSIE 7.0/", $_SERVER['HTTP_USER_AGENT']) && preg_match("/Trident\/([0-9\.]+)/", $_SERVER['HTTP_USER_AGENT']))) {
|
||||
// IE 9 Compatibility View doesn't support SVG. Say no.
|
||||
$this->usesvg = false;
|
||||
} else if (preg_match('#Android +[0-2]\.#', $_SERVER['HTTP_USER_AGENT'])) {
|
||||
// Android < 3 doesn't support SVG. Say no.
|
||||
$this->usesvg = false;
|
||||
|
||||
@@ -187,14 +187,22 @@ class theme_config_testcase extends advanced_testcase {
|
||||
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)' => false,
|
||||
// IE8 on Vista.
|
||||
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0)' => false,
|
||||
// IE8 on Vista in compatability mode.
|
||||
// IE8 on Vista in compatibility mode.
|
||||
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0)' => false,
|
||||
// IE8 on Windows 7.
|
||||
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)' => false,
|
||||
// IE9 on Windows 7.
|
||||
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)' => true,
|
||||
// IE9 on Windows 7 in intranet mode.
|
||||
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/5.0)' => true,
|
||||
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/5.0)' => false,
|
||||
// IE10 on Windows 8.
|
||||
'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0; Touch)' => true,
|
||||
// IE10 on Windows 8 in compatibility mode.
|
||||
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; Trident/6.0; Touch; .NET4.0E; .NET4.0C; Tablet PC 2.0)' => true,
|
||||
// IE11 on Windows 8.
|
||||
'Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0)' => true,
|
||||
// IE11 on Windows 8 in compatibility mode.
|
||||
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.3; Trident/7.0; .NET4.0E; .NET4.0C)' => true,
|
||||
// Chrome 11 on Windows.
|
||||
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US) AppleWebKit/534.17 (KHTML, like Gecko) Chrome/11.0.652.0 Safari/534.17' => true,
|
||||
// Chrome 22 on Windows.
|
||||
@@ -209,12 +217,14 @@ class theme_config_testcase extends advanced_testcase {
|
||||
'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1' => true,
|
||||
// Opera 12.02 on Ubuntu.
|
||||
'Opera/9.80 (X11; Linux x86_64; U; en) Presto/2.10.289 Version/12.02' => false,
|
||||
// Android browser pre 1.0
|
||||
// Android browser pre 1.0.
|
||||
'Mozilla/5.0 (Linux; U; Android 0.5; en-us) AppleWebKit/522+ (KHTML, like Gecko) Safari/419.3' => false,
|
||||
// Android browser 2.3 (HTC)
|
||||
// Android browser 2.3 (HTC).
|
||||
'Mozilla/5.0 (Linux; U; Android 2.3.5; en-us; HTC Vision Build/GRI40) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1' => false,
|
||||
// Android browser 3.0 (Motorola)
|
||||
'Mozilla/5.0 (Linux; U; Android 3.0; en-us; Xoom Build/HRI39) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13' => true
|
||||
// Android browser 3.0 (Motorola).
|
||||
'Mozilla/5.0 (Linux; U; Android 3.0; en-us; Xoom Build/HRI39) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13' => true,
|
||||
// Android browser 4.3 (Samsung GT-9505).
|
||||
'Mozilla/5.0 (Linux; Android 4.3; it-it; SAMSUNG GT-I9505/I9505XXUEMJ7 Build/JSS15J) AppleWebKit/537.36 (KHTML, like Gecko) Version/1.5 Chrome/28.0.1500.94 Mobile Safari/537.36' => true
|
||||
);
|
||||
foreach ($useragents as $agent => $expected) {
|
||||
$_SERVER['HTTP_USER_AGENT'] = $agent;
|
||||
|
||||
Reference in New Issue
Block a user