From 4ea8fc0a7ee4c485047a6097c99b4a693dfa7c79 Mon Sep 17 00:00:00 2001 From: Gareth J Barnard Date: Thu, 29 Jan 2015 16:11:43 +0000 Subject: [PATCH] MDL-49074 themes: WOFF2 fonts are not supported. Backport of MDL-46728. --- theme/font.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/theme/font.php b/theme/font.php index 87f27f1b88e..d6d5e22208a 100644 --- a/theme/font.php +++ b/theme/font.php @@ -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';