Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'm24_MDL-43082_IE9_Compat_View_SVG_Say_No' of https://gi…

…thub.com/scara/moodle into MOODLE_24_STABLE
  • Loading branch information...
commit 143c8e7489114103301b1b7a947a6846e422ef1a 2 parents 10f476e + 3f007ca
@marinaglancy marinaglancy authored
Showing with 21 additions and 6 deletions.
  1. +5 −0 lib/outputlib.php
  2. +16 −6 lib/tests/outputlib_test.php
View
5 lib/outputlib.php
@@ -1145,6 +1145,11 @@ public function use_svg_icons() {
} 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;
View
22 lib/tests/outputlib_test.php
@@ -187,14 +187,22 @@ public function test_svg_image_use() {
'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 @@ public function test_svg_image_use() {
'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;
Please sign in to comment.
Something went wrong with that request. Please try again.