diff --git a/src/infrastructure/celerity/CelerityResourceTransformer.php b/src/infrastructure/celerity/CelerityResourceTransformer.php --- a/src/infrastructure/celerity/CelerityResourceTransformer.php +++ b/src/infrastructure/celerity/CelerityResourceTransformer.php @@ -111,6 +111,17 @@ 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 @@ } } - return 'url('.$uri.')'; + return 'url('.$uri.$tail.')'; } private function replaceCSSVariables($path, $data) {