From 1ab919544c37712952e2c8cc2ea902ec7e02dcec Mon Sep 17 00:00:00 2001 From: epriestley Date: Sun, 3 May 2015 16:16:50 -0700 Subject: [PATCH] Probably fix cross-origin font requests in IE Summary: Ref T8013. Test Plan: no u Reviewers: chad Reviewed By: chad Subscribers: epriestley Maniphest Tasks: T8013 Differential Revision: https://secure.phabricator.com/D12684 --- .../controller/CelerityResourceController.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/applications/celerity/controller/CelerityResourceController.php b/src/applications/celerity/controller/CelerityResourceController.php index 9c7b472e88..c91f9297c4 100644 --- a/src/applications/celerity/controller/CelerityResourceController.php +++ b/src/applications/celerity/controller/CelerityResourceController.php @@ -101,8 +101,15 @@ abstract class CelerityResourceController extends PhabricatorController { $response->setMimeType($type_map[$type]); // NOTE: This is a piece of magic required to make WOFF fonts work in - // Firefox. Possibly we should generalize this. - if ($type == 'woff' || $type == 'woff2') { + // Firefox and IE. Possibly we should generalize this more. + + $cross_origin_types = array( + 'woff' => true, + 'woff2' => true, + 'eot' => true, + ); + + if (isset($cross_origin_types[$type])) { // We could be more tailored here, but it's not currently trivial to // generate a comprehensive list of valid origins (an install may have // arbitrarily many Phame blogs, for example), and we lose nothing by