mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 12:32:08 +02:00
MDL-78993 theme: Remove $CFG->svgicons
The $CFG->svgicons setting was introduced in Moodle 2.4 due to incomplete SVG support in certain web browsers. The landscape has evolved significantly since then, and all modern browsers now handle SVG files correctly. The $CFG->svgicons settings has been removed and the supports_svg() method has been updated with currently supported browsers (IE support was removed in Moodle 3.10).
This commit is contained in:
parent
b4c6ed3650
commit
ff844ab7bd
File diff suppressed because one or more lines are too long
@ -577,18 +577,6 @@ $CFG->admin = 'admin';
|
||||
//
|
||||
// $CFG->preventscheduledtaskchanges = true;
|
||||
//
|
||||
// As of version 2.4 Moodle serves icons as SVG images if the users browser appears
|
||||
// to support SVG.
|
||||
// For those wanting to control the serving of SVG images the following setting can
|
||||
// be defined in your config.php.
|
||||
// If it is not defined then the default (browser detection) will occur.
|
||||
//
|
||||
// To ensure they are always used when available:
|
||||
// $CFG->svgicons = true;
|
||||
//
|
||||
// To ensure they are never used even when available:
|
||||
// $CFG->svgicons = false;
|
||||
//
|
||||
// Some administration options allow setting the path to executable files. This can
|
||||
// potentially cause a security risk. Set this option to true to disable editing
|
||||
// those config settings via the web. They will need to be set explicitly in the
|
||||
|
@ -525,7 +525,7 @@ class helper_test extends \advanced_testcase {
|
||||
|
||||
$cartridge = \enrol_lti\helper::create_cartridge($tool1->id);
|
||||
$this->assertStringContainsString('<blti:title>Test LTI</blti:title>', $cartridge);
|
||||
$this->assertStringContainsString("<blti:icon>$CFG->wwwroot/theme/image.php/_s/boost/theme/1/favicon</blti:icon>", $cartridge);
|
||||
$this->assertStringContainsString("<blti:icon>$CFG->wwwroot/theme/image.php/boost/theme/1/favicon</blti:icon>", $cartridge);
|
||||
$this->assertStringContainsString("<blti:launch_url>$CFG->wwwroot/enrol/lti/tool.php?id=$tool1->id</blti:launch_url>", $cartridge);
|
||||
}
|
||||
}
|
||||
|
@ -958,26 +958,13 @@ class core_useragent {
|
||||
* @return bool
|
||||
*/
|
||||
public static function supports_svg() {
|
||||
// IE 5 - 8 don't support SVG at all.
|
||||
$instance = self::instance();
|
||||
if ($instance->supportssvg === null) {
|
||||
if ($instance->useragent === false) {
|
||||
// Can't be sure, just say no.
|
||||
$instance->supportssvg = false;
|
||||
} else if (self::check_ie_version('0') and !self::check_ie_version('9')) {
|
||||
// IE < 9 doesn't support SVG. Say no.
|
||||
$instance->supportssvg = false;
|
||||
} else if (self::is_ie() and !self::check_ie_version('10') and self::check_ie_compatibility_view()) {
|
||||
// IE 9 Compatibility View doesn't support SVG. Say no.
|
||||
$instance->supportssvg = false;
|
||||
} else if (preg_match('#Android +[0-2]\.#', $instance->useragent)) {
|
||||
// Android < 3 doesn't support SVG. Say no.
|
||||
$instance->supportssvg = false;
|
||||
} else if (self::is_opera()) {
|
||||
// Opera 12 still does not support SVG well enough. Say no.
|
||||
if (preg_match('#Android +[0-2]\.#', $instance->useragent)) {
|
||||
// Android < 3 doesn't support SVG.
|
||||
$instance->supportssvg = false;
|
||||
} else {
|
||||
// Presumed fine.
|
||||
// With widespread SVG support in modern browsers, default to returning true (even when useragent is false).
|
||||
$instance->supportssvg = true;
|
||||
}
|
||||
}
|
||||
|
@ -2093,8 +2093,7 @@ class theme_config {
|
||||
*
|
||||
* @param string $image name of image, may contain relative path
|
||||
* @param string $component
|
||||
* @param bool $svg|null Should SVG images also be looked for? If null, resorts to $CFG->svgicons if that is set; falls back to
|
||||
* auto-detection of browser support otherwise
|
||||
* @param bool $svg|null Should SVG images also be looked for? If null, falls back to auto-detection of browser support
|
||||
* @return string full file path
|
||||
*/
|
||||
public function resolve_image_location($image, $component, $svg = false) {
|
||||
@ -2251,16 +2250,10 @@ class theme_config {
|
||||
* @return bool
|
||||
*/
|
||||
public function use_svg_icons() {
|
||||
global $CFG;
|
||||
if ($this->usesvg === null) {
|
||||
|
||||
if (!isset($CFG->svgicons)) {
|
||||
$this->usesvg = core_useragent::supports_svg();
|
||||
} else {
|
||||
// Force them on/off depending upon the setting.
|
||||
$this->usesvg = (bool)$CFG->svgicons;
|
||||
}
|
||||
$this->usesvg = core_useragent::supports_svg();
|
||||
}
|
||||
|
||||
return $this->usesvg;
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ class filter_manager_test extends \advanced_testcase {
|
||||
filter_set_global_state('emoticon', TEXTFILTER_ON);
|
||||
$this->assertMatchesRegularExpression(
|
||||
'~^<p><img class="icon emoticon" alt="smile" title="smile" ' .
|
||||
'src="https://www.example.com/moodle/theme/image.php/_s/boost/core/1/s/smiley" /></p>$~',
|
||||
'src="https://www.example.com/moodle/theme/image.php/boost/core/1/s/smiley" /></p>$~',
|
||||
$this->filter_text('<p>:-)</p>', array()));
|
||||
}
|
||||
|
||||
@ -65,7 +65,7 @@ class filter_manager_test extends \advanced_testcase {
|
||||
$this->resetAfterTest();
|
||||
filter_set_global_state('emoticon', TEXTFILTER_ON);
|
||||
$this->assertMatchesRegularExpression('~^<p><img class="icon emoticon" alt="smile" ' .
|
||||
'title="smile" src="https://www.example.com/moodle/theme/image.php/_s/boost/core/1/s/smiley" /></p>$~',
|
||||
'title="smile" src="https://www.example.com/moodle/theme/image.php/boost/core/1/s/smiley" /></p>$~',
|
||||
$this->filter_text('<p>:-)</p>', array('urltolink')));
|
||||
}
|
||||
|
||||
@ -74,7 +74,7 @@ class filter_manager_test extends \advanced_testcase {
|
||||
filter_set_global_state('emoticon', TEXTFILTER_ON);
|
||||
filter_set_global_state('urltolink', TEXTFILTER_ON);
|
||||
$this->assertMatchesRegularExpression('~^<p><img class="icon emoticon" alt="smile" title="smile" ' .
|
||||
'src="https://www.example.com/moodle/theme/image.php/_s/boost/core/1/s/smiley" /> http://google.com/</p>$~',
|
||||
'src="https://www.example.com/moodle/theme/image.php/boost/core/1/s/smiley" /> http://google.com/</p>$~',
|
||||
$this->filter_text('<p>:-) http://google.com/</p>', array('glossary', 'urltolink')));
|
||||
}
|
||||
}
|
||||
|
@ -140,9 +140,6 @@ class outputcomponents_test extends \advanced_testcase {
|
||||
|
||||
$this->resetAfterTest();
|
||||
|
||||
// Force SVG on so that we have predictable URL's.
|
||||
$CFG->svgicons = true;
|
||||
|
||||
// Verify new install contains expected defaults.
|
||||
$this->assertSame(theme_config::DEFAULT_THEME, $CFG->theme);
|
||||
$this->assertEquals(1, $CFG->slasharguments);
|
||||
|
@ -58,43 +58,12 @@ class theme_config_test extends advanced_testcase {
|
||||
$imagefile = $theme->resolve_image_location('i/test', 'moodle', false);
|
||||
$this->assertSame('test.png', basename($imagefile));
|
||||
|
||||
// Now test the use of the svgicons config setting.
|
||||
// We need to clone the theme as usesvg property is calculated only once.
|
||||
$testtheme = clone $theme;
|
||||
$CFG->svgicons = true;
|
||||
$imagefile = $testtheme->resolve_image_location('i/test', 'moodle', null);
|
||||
$this->assertSame('test.svg', basename($imagefile));
|
||||
$CFG->svgicons = false;
|
||||
// We need to clone the theme as usesvg property is calculated only once.
|
||||
$testtheme = clone $theme;
|
||||
$imagefile = $testtheme->resolve_image_location('i/test', 'moodle', null);
|
||||
$this->assertSame('test.png', basename($imagefile));
|
||||
unset($CFG->svgicons);
|
||||
|
||||
// Finally test a few user agents.
|
||||
$useragents = array(
|
||||
// IE7 on XP.
|
||||
'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 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)' => 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.
|
||||
$useragents = [
|
||||
'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,
|
||||
'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.
|
||||
'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/22.0.1207.1 Safari/537.1' => true,
|
||||
// Chrome 21 on Ubuntu 12.04.
|
||||
@ -105,17 +74,21 @@ class theme_config_test extends advanced_testcase {
|
||||
'Mozilla/5.0 (Windows NT 6.1; rv:15.0) Gecko/20120716 Firefox/15.0.1' => true,
|
||||
// Firefox 15 on Ubuntu.
|
||||
'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,
|
||||
// Opera 15 on MacOS.
|
||||
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 ' .
|
||||
'Safari/537.36 OPR/15.0.1147.153' => true,
|
||||
// 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).
|
||||
'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,
|
||||
'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,
|
||||
'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
|
||||
);
|
||||
'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) {
|
||||
core_useragent::instance(true, $agent);
|
||||
// We need to clone the theme as usesvg property is calculated only once.
|
||||
|
@ -101,286 +101,6 @@ class useragent_test extends advanced_testcase {
|
||||
'devicetype' => 'mobile',
|
||||
),
|
||||
),
|
||||
// Windows 98; Internet Explorer 5.0.
|
||||
array(
|
||||
'Mozilla/4.0 (compatible; MSIE 5.00; Windows 98)',
|
||||
array(
|
||||
// MSIE 5.0 is not considered a browser at all: known false results.
|
||||
'is_ie' => false,
|
||||
'check_ie_version' => array(
|
||||
'0' => true,
|
||||
'5.0' => true,
|
||||
),
|
||||
'versionclasses' => array(
|
||||
// IE 5.0 is not considered a browser.
|
||||
),
|
||||
|
||||
// IE 5.0 is a legacy browser.
|
||||
'devicetype' => 'legacy',
|
||||
|
||||
'supports_svg' => false,
|
||||
'supports_json_contenttype' => false,
|
||||
),
|
||||
),
|
||||
|
||||
// Windows 2000; Internet Explorer 5.5.
|
||||
array(
|
||||
'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)',
|
||||
array(
|
||||
'is_ie' => true,
|
||||
'check_ie_version' => array(
|
||||
'0' => true,
|
||||
'5.0' => true,
|
||||
'5.5' => true,
|
||||
),
|
||||
'versionclasses' => array(
|
||||
'ie',
|
||||
),
|
||||
|
||||
// IE 6.0 is a legacy browser.
|
||||
'devicetype' => 'legacy',
|
||||
|
||||
'supports_svg' => false,
|
||||
'supports_json_contenttype' => false,
|
||||
),
|
||||
),
|
||||
|
||||
// Windows XP SP2; Internet Explorer 6.0.
|
||||
array(
|
||||
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)',
|
||||
array(
|
||||
'is_ie' => true,
|
||||
'check_ie_version' => array(
|
||||
'0' => true,
|
||||
'5.0' => true,
|
||||
'5.5' => true,
|
||||
'6.0' => true,
|
||||
),
|
||||
'versionclasses' => array(
|
||||
'ie',
|
||||
'ie6',
|
||||
),
|
||||
|
||||
// IE 7.0 is a legacy browser.
|
||||
'devicetype' => 'legacy',
|
||||
|
||||
'supports_svg' => false,
|
||||
'supports_json_contenttype' => false,
|
||||
),
|
||||
),
|
||||
|
||||
// Windows XP SP2; Internet Explorer 7.0.
|
||||
array(
|
||||
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; YPC 3.0.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
|
||||
array(
|
||||
'is_ie' => true,
|
||||
'check_ie_version' => array(
|
||||
'0' => true,
|
||||
'5.0' => true,
|
||||
'5.5' => true,
|
||||
'6.0' => true,
|
||||
'7.0' => true,
|
||||
),
|
||||
'versionclasses' => array(
|
||||
'ie',
|
||||
'ie7',
|
||||
),
|
||||
|
||||
'supports_svg' => false,
|
||||
'supports_json_contenttype' => false,
|
||||
),
|
||||
),
|
||||
|
||||
// Windows XP SP2; Internet Explorer 7.0; Meridio extension.
|
||||
array(
|
||||
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Meridio for Excel 5.0.251; Meridio for PowerPoint 5.0.251; Meridio for Word 5.0.251; Meridio Protocol; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)',
|
||||
array(
|
||||
'is_ie' => true,
|
||||
'check_ie_version' => array(
|
||||
'0' => true,
|
||||
'5.0' => true,
|
||||
'5.5' => true,
|
||||
'6.0' => true,
|
||||
'7.0' => true,
|
||||
),
|
||||
'versionclasses' => array(
|
||||
'ie',
|
||||
'ie7',
|
||||
),
|
||||
|
||||
'supports_svg' => false,
|
||||
'supports_json_contenttype' => false,
|
||||
),
|
||||
),
|
||||
|
||||
// Windows Vista; Internet Explorer 8.0.
|
||||
array(
|
||||
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648)',
|
||||
array(
|
||||
'is_ie' => true,
|
||||
'check_ie_version' => array(
|
||||
'0' => true,
|
||||
'5.0' => true,
|
||||
'5.5' => true,
|
||||
'6.0' => true,
|
||||
'7.0' => true,
|
||||
'8.0' => true,
|
||||
),
|
||||
'versionclasses' => array(
|
||||
'ie',
|
||||
'ie8',
|
||||
),
|
||||
|
||||
'supports_svg' => false,
|
||||
),
|
||||
),
|
||||
|
||||
// Windows 7; Internet Explorer 9.0.
|
||||
array(
|
||||
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)',
|
||||
array(
|
||||
'is_ie' => true,
|
||||
'check_ie_version' => array(
|
||||
'0' => true,
|
||||
'5.0' => true,
|
||||
'5.5' => true,
|
||||
'6.0' => true,
|
||||
'7.0' => true,
|
||||
'8.0' => true,
|
||||
'9.0' => true,
|
||||
),
|
||||
'versionclasses' => array(
|
||||
'ie',
|
||||
'ie9',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// Windows 7; Internet Explorer 9.0i.
|
||||
array(
|
||||
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)',
|
||||
array(
|
||||
'is_ie' => true,
|
||||
'check_ie_version' => array(
|
||||
'0' => true,
|
||||
'5.0' => true,
|
||||
'5.5' => true,
|
||||
'6.0' => true,
|
||||
'7.0' => true,
|
||||
'8.0' => true,
|
||||
'9.0' => true,
|
||||
),
|
||||
'versionclasses' => array(
|
||||
'ie',
|
||||
'ie9',
|
||||
),
|
||||
'iecompatibility' => true,
|
||||
|
||||
// IE 9 in Compatiblity mode does not support SVG.
|
||||
'supports_svg' => false,
|
||||
|
||||
// IE in Compatiblity mode does not support JSON ContentType.
|
||||
'supports_json_contenttype' => false,
|
||||
),
|
||||
),
|
||||
|
||||
// Windows 8; Internet Explorer 10.0.
|
||||
array(
|
||||
'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0; Touch)',
|
||||
array(
|
||||
'is_ie' => true,
|
||||
'check_ie_version' => array(
|
||||
'0' => true,
|
||||
'5.0' => true,
|
||||
'5.5' => true,
|
||||
'6.0' => true,
|
||||
'7.0' => true,
|
||||
'8.0' => true,
|
||||
'9.0' => true,
|
||||
'10' => true,
|
||||
),
|
||||
'versionclasses' => array(
|
||||
'ie',
|
||||
'ie10',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// Windows 8; Internet Explorer 10.0i.
|
||||
array(
|
||||
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; Trident/6.0; Touch; .NET4.0E; .NET4.0C; Tablet PC 2.0)',
|
||||
array(
|
||||
'is_ie' => true,
|
||||
'check_ie_version' => array(
|
||||
'0' => true,
|
||||
'5.0' => true,
|
||||
'5.5' => true,
|
||||
'6.0' => true,
|
||||
'7.0' => true,
|
||||
'8.0' => true,
|
||||
'9.0' => true,
|
||||
'10' => true,
|
||||
),
|
||||
'iecompatibility' => true,
|
||||
'versionclasses' => array(
|
||||
'ie',
|
||||
'ie10',
|
||||
),
|
||||
|
||||
// IE in Compatiblity mode does not support JSON ContentType.
|
||||
'supports_json_contenttype' => false,
|
||||
),
|
||||
),
|
||||
|
||||
// Windows 8.1; Internet Explorer 11.0.
|
||||
array(
|
||||
'Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0)',
|
||||
array(
|
||||
'is_ie' => true,
|
||||
'check_ie_version' => array(
|
||||
'0' => true,
|
||||
'5.0' => true,
|
||||
'5.5' => true,
|
||||
'6.0' => true,
|
||||
'7.0' => true,
|
||||
'8.0' => true,
|
||||
'9.0' => true,
|
||||
'10' => true,
|
||||
'11' => true,
|
||||
),
|
||||
'versionclasses' => array(
|
||||
'ie',
|
||||
'ie11',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// Windows 8.1; Internet Explorer 11.0i.
|
||||
array(
|
||||
' Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.3; Trident/7.0; .NET4.0E; .NET4.0C)',
|
||||
array(
|
||||
'is_ie' => true,
|
||||
'check_ie_version' => array(
|
||||
'0' => true,
|
||||
'5.0' => true,
|
||||
'5.5' => true,
|
||||
'6.0' => true,
|
||||
'7.0' => true,
|
||||
'8.0' => true,
|
||||
'9.0' => true,
|
||||
'10' => true,
|
||||
'11' => true,
|
||||
),
|
||||
'iecompatibility' => true,
|
||||
'versionclasses' => array(
|
||||
'ie',
|
||||
'ie11',
|
||||
),
|
||||
|
||||
// IE in Compatiblity mode does not support JSON ContentType.
|
||||
'supports_json_contenttype' => false,
|
||||
),
|
||||
),
|
||||
|
||||
// Windows XP; Firefox 1.0.6.
|
||||
array(
|
||||
@ -763,59 +483,6 @@ class useragent_test extends advanced_testcase {
|
||||
),
|
||||
),
|
||||
|
||||
// Windows 7; MS Word 2010.
|
||||
array(
|
||||
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C; .NET4.0E; ms-office)',
|
||||
array(
|
||||
'is_ie' => true,
|
||||
'check_ie_version' => array(
|
||||
'0' => true,
|
||||
'5.0' => true,
|
||||
'5.5' => true,
|
||||
'6.0' => true,
|
||||
'7.0' => true,
|
||||
'8.0' => true,
|
||||
),
|
||||
'iecompatibility' => true,
|
||||
'versionclasses' => array(
|
||||
'ie',
|
||||
'ie8',
|
||||
),
|
||||
|
||||
'is_msword' => true,
|
||||
|
||||
'supports_svg' => false,
|
||||
'supports_json_contenttype' => false,
|
||||
),
|
||||
),
|
||||
|
||||
// Windows 7; MS Outlook 2010.
|
||||
array(
|
||||
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C; .NET4.0E; Microsoft Outlook 14.0.7113; ms-office; MSOffice 14)',
|
||||
array(
|
||||
'is_ie' => true,
|
||||
'check_ie_version' => array(
|
||||
'0' => true,
|
||||
'5.0' => true,
|
||||
'5.5' => true,
|
||||
'6.0' => true,
|
||||
'7.0' => true,
|
||||
'8.0' => true,
|
||||
),
|
||||
'iecompatibility' => true,
|
||||
'versionclasses' => array(
|
||||
'ie',
|
||||
'ie8',
|
||||
),
|
||||
|
||||
// Note: Outlook is deliberately not considered to be MS Word.
|
||||
'is_msword' => false,
|
||||
|
||||
'supports_svg' => false,
|
||||
'supports_json_contenttype' => false,
|
||||
),
|
||||
),
|
||||
|
||||
// Mac OS X; MS Word 14.
|
||||
array(
|
||||
'Mozilla/5.0 (Macintosh; Intel Mac OS X) Word/14.38.0',
|
||||
@ -1083,41 +750,6 @@ class useragent_test extends advanced_testcase {
|
||||
),
|
||||
),
|
||||
|
||||
// Opera 8.51; Windows XP.
|
||||
array(
|
||||
'Opera/8.51 (Windows NT 5.1; U; en)',
|
||||
array(
|
||||
'is_opera' => true,
|
||||
'check_opera_version' => array(
|
||||
'8.0' => true,
|
||||
),
|
||||
|
||||
'versionclasses' => array(
|
||||
'opera',
|
||||
),
|
||||
|
||||
'supports_svg' => false,
|
||||
),
|
||||
),
|
||||
|
||||
// Opera 9.0; Windows XP.
|
||||
array(
|
||||
'Opera/9.0 (Windows NT 5.1; U; en)',
|
||||
array(
|
||||
'is_opera' => true,
|
||||
'check_opera_version' => array(
|
||||
'8.0' => true,
|
||||
'9.0' => true,
|
||||
),
|
||||
|
||||
'versionclasses' => array(
|
||||
'opera',
|
||||
),
|
||||
|
||||
'supports_svg' => false,
|
||||
),
|
||||
),
|
||||
|
||||
// Opera 12.15 (Build 1748); Mac OS X.
|
||||
array(
|
||||
'Opera/9.80 (Macintosh; Intel Mac OS X 10.10.0; Edition MAS) Presto/2.12.388 Version/12.15',
|
||||
@ -1133,26 +765,6 @@ class useragent_test extends advanced_testcase {
|
||||
'versionclasses' => array(
|
||||
'opera',
|
||||
),
|
||||
|
||||
'supports_svg' => false,
|
||||
),
|
||||
),
|
||||
|
||||
// Opera 9.0; Debian Linux.
|
||||
array(
|
||||
'Opera/9.01 (X11; Linux i686; U; en)',
|
||||
array(
|
||||
'is_opera' => true,
|
||||
'check_opera_version' => array(
|
||||
'8.0' => true,
|
||||
'9.0' => true,
|
||||
),
|
||||
|
||||
'versionclasses' => array(
|
||||
'opera',
|
||||
),
|
||||
|
||||
'supports_svg' => false,
|
||||
),
|
||||
),
|
||||
|
||||
|
@ -30,7 +30,7 @@ class weblib_format_text_test extends \advanced_testcase {
|
||||
$this->resetAfterTest();
|
||||
filter_set_global_state('emoticon', TEXTFILTER_ON);
|
||||
$this->assertMatchesRegularExpression('~^<p><img class="icon emoticon" alt="smile" title="smile" ' .
|
||||
'src="https://www.example.com/moodle/theme/image.php/_s/boost/core/1/s/smiley" /></p>$~',
|
||||
'src="https://www.example.com/moodle/theme/image.php/boost/core/1/s/smiley" /></p>$~',
|
||||
format_text('<p>:-)</p>', FORMAT_HTML));
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ class weblib_format_text_test extends \advanced_testcase {
|
||||
$this->resetAfterTest();
|
||||
filter_set_global_state('emoticon', TEXTFILTER_ON);
|
||||
$this->assertMatchesRegularExpression('~^<p><em><img class="icon emoticon" alt="smile" title="smile" ' .
|
||||
'src="https://www.example.com/moodle/theme/image.php/_s/boost/core/1/s/smiley" />' .
|
||||
'src="https://www.example.com/moodle/theme/image.php/boost/core/1/s/smiley" />' .
|
||||
'</em></p>\n$~',
|
||||
format_text('*:-)*', FORMAT_MARKDOWN));
|
||||
}
|
||||
@ -77,7 +77,7 @@ class weblib_format_text_test extends \advanced_testcase {
|
||||
filter_set_global_state('emoticon', TEXTFILTER_ON);
|
||||
$this->assertMatchesRegularExpression('~^<div class="text_to_html"><p>' .
|
||||
'<img class="icon emoticon" alt="smile" title="smile" ' .
|
||||
'src="https://www.example.com/moodle/theme/image.php/_s/boost/core/1/s/smiley" /></p></div>$~',
|
||||
'src="https://www.example.com/moodle/theme/image.php/boost/core/1/s/smiley" /></p></div>$~',
|
||||
format_text('<p>:-)</p>', FORMAT_MOODLE));
|
||||
}
|
||||
|
||||
|
@ -167,6 +167,7 @@ being forced open in all behat tests.
|
||||
the grade item once the recalculations are completed. (This was fixed in 4.3, 4.2.2)
|
||||
* Added a new constant called MAX_PASSWORD_CHARACTERS in moodlelib.php to hold a length of accepted password.
|
||||
* Added a new method called exceeds_password_length in moodlelib.php to validate the password length.
|
||||
* The $CFG->svgicons setting has been removed because all modern browsers now handle SVG files correctly.
|
||||
|
||||
=== 4.2 ===
|
||||
|
||||
|
@ -1760,7 +1760,7 @@ class api_test extends messagelib_test {
|
||||
// Consider first conversations is self-conversation.
|
||||
$this->assertEquals(2, $conversations[0]->membercount);
|
||||
$this->assertEquals($course1->shortname, $conversations[0]->subname);
|
||||
$this->assertEquals('https://www.example.com/moodle/theme/image.php/_s/boost/core/1/g/g1', $conversations[0]->imageurl);
|
||||
$this->assertEquals('https://www.example.com/moodle/theme/image.php/boost/core/1/g/g1', $conversations[0]->imageurl);
|
||||
|
||||
// Now, disable the conversation linked to the group and verify it's no longer returned.
|
||||
$DB->set_field('message_conversations', 'enabled', 0, ['id' => $conversations[0]->id]);
|
||||
|
@ -42,7 +42,7 @@ abstract class repository_googledocs_testcase extends \advanced_testcase {
|
||||
'title' => $name,
|
||||
'path' => repository_googledocs\helper::build_node_path($id, $name, $path),
|
||||
'date' => $modified,
|
||||
'thumbnail' => "{$CFG->wwwroot}/theme/image.php/_s/boost/core/1/" . file_folder_icon(),
|
||||
'thumbnail' => "{$CFG->wwwroot}/theme/image.php/boost/core/1/" . file_folder_icon(),
|
||||
'thumbnail_height' => 64,
|
||||
'thumbnail_width' => 64,
|
||||
'children' => [],
|
||||
|
Loading…
x
Reference in New Issue
Block a user