MDL-49074 themes: WOFF2 fonts are not supported. Backport of MDL-46728.

This commit is contained in:
Gareth J Barnard
2015-03-03 10:43:18 +00:00
parent deea56cf6f
commit 4ea8fc0a7e
+5 -1
View File
@@ -57,7 +57,11 @@ if (empty($component) or $component === 'moodle' or $component === 'core') {
$component = 'core';
}
if (preg_match('/^[a-z0-9_-]+\.woff$/i', $font, $matches)) {
if (preg_match('/^[a-z0-9_-]+\.woff2$/i', $font, $matches)) {
$font = $matches[0];
$mimetype = 'application/font-woff2';
} else if (preg_match('/^[a-z0-9_-]+\.woff$/i', $font, $matches)) {
// This is the real standard!
$font = $matches[0];
$mimetype = 'application/font-woff';