Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
JanDC committed Oct 21, 2017
1 parent e25d2d6 commit d8747d9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/CriticalCssProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ public function process($rawHtml, $name = '', $context = [], $environment = null
foreach ($document->getElementsByTagName('link') as $linkTag) {
/** @var DOMElement $linkTag */
if ($linkTag->getAttribute('rel') == 'stylesheet') {
$stylesheet = $linkTag->getAttribute('href');

$stylesheet = reset(explode('?', $stylesheet));
$tokenisedStylesheet = explode('?', $linkTag->getAttribute('href'));
$stylesheet = reset($tokenisedStylesheet);

if (($content = @file_get_contents($stylesheet)) !== false) {
$extractorExtension->addBaseRules($content);
Expand Down

0 comments on commit d8747d9

Please sign in to comment.