diff --git a/src/infrastructure/celerity/CelerityResourceTransformer.php b/src/infrastructure/celerity/CelerityResourceTransformer.php index 27ce836d54..201ea387e1 100644 --- a/src/infrastructure/celerity/CelerityResourceTransformer.php +++ b/src/infrastructure/celerity/CelerityResourceTransformer.php @@ -111,6 +111,17 @@ final class CelerityResourceTransformer { public function translateResourceURI(array $matches) { $uri = trim($matches[1], "'\" \r\t\n"); + $tail = ''; + + // If the resource URI has a query string or anchor, strip it off before + // we go looking for the resource. We'll stitch it back on later. This + // primarily affects FontAwesome. + + $parts = preg_split('/(?=[?#])/', $uri, 2); + if (count($parts) == 2) { + $uri = $parts[0]; + $tail = $parts[1]; + } $alternatives = array_unique( array( @@ -142,7 +153,7 @@ final class CelerityResourceTransformer { } } - return 'url('.$uri.')'; + return 'url('.$uri.$tail.')'; } private function replaceCSSVariables($path, $data) {