mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 00:16:46 +02:00
MDL-72646 theme: update font download MIME types, RFC-8081
This commit is contained in:
parent
d24a4ab56f
commit
55fff62fb4
1 changed files with 5 additions and 5 deletions
|
@ -17,7 +17,7 @@
|
|||
/**
|
||||
* This file is responsible for serving the fonts used in CSS.
|
||||
*
|
||||
* Note: it is recommended to use only WOFF (Web Open Font Format) fonts.
|
||||
* Note: it is recommended to use only WOFF2 (Web Open Font Format v2) fonts.
|
||||
*
|
||||
* @package core
|
||||
* @copyright 2013 Petr Skoda (skodak) {@link http://skodak.org}
|
||||
|
@ -63,20 +63,20 @@ if (empty($component) or $component === 'moodle' or $component === 'core') {
|
|||
|
||||
if (preg_match('/^[a-z0-9_-]+\.woff2$/i', $font, $matches)) {
|
||||
$font = $matches[0];
|
||||
$mimetype = 'application/font-woff2';
|
||||
$mimetype = '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';
|
||||
$mimetype = 'font/woff';
|
||||
|
||||
} else if (preg_match('/^[a-z0-9_-]+\.ttf$/i', $font, $matches)) {
|
||||
$font = $matches[0];
|
||||
$mimetype = 'application/x-font-ttf';
|
||||
$mimetype = 'font/ttf';
|
||||
|
||||
} else if (preg_match('/^[a-z0-9_-]+\.otf$/i', $font, $matches)) {
|
||||
$font = $matches[0];
|
||||
$mimetype = 'application/x-font-opentype';
|
||||
$mimetype = 'font/otf';
|
||||
|
||||
} else if (preg_match('/^[a-z0-9_-]+\.eot$/i', $font, $matches)) {
|
||||
// IE8 must die!!!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue