From 964485a3a0c2d0a9ff8b9ad60a3118c9916a5dff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20S=CC=8Ckoda?= Date: Wed, 24 Jul 2013 08:52:22 +0200 Subject: [PATCH] MDL-23493 fix borked regex matching for non-standard font extensions --- theme/font.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/theme/font.php b/theme/font.php index 8b26d256828..2f4c015ebb7 100644 --- a/theme/font.php +++ b/theme/font.php @@ -62,15 +62,15 @@ if (preg_match('/^[a-z0-9_-]+\.woff$/i', $font, $matches)) { $font = $matches[0]; $mimetype = 'application/font-woff'; -} else if (preg_match('^[a-z0-9_-]+/\.ttf$/i', $font, $matches)) { +} else if (preg_match('/^[a-z0-9_-]+\.ttf$/i', $font, $matches)) { $font = $matches[0]; $mimetype = 'application/x-font-ttf'; -} else if (preg_match('^[a-z0-9_-]+/\.otf$/i', $font, $matches)) { +} else if (preg_match('/^[a-z0-9_-]+\.otf$/i', $font, $matches)) { $font = $matches[0]; $mimetype = 'application/x-font-opentype'; -} else if (preg_match('^[a-z0-9_-]+/\.oet$/i', $font, $matches)) { +} else if (preg_match('/^[a-z0-9_-]+\.oet$/i', $font, $matches)) { // IE8 must die!!! $font = $matches[0]; $mimetype = 'application/vnd.ms-fontobject';