Skip to content

Commit

Permalink
Merge pull request #43 from Belphemur/patch-1
Browse files Browse the repository at this point in the history
Avoid problem with HTML with fault
  • Loading branch information
ceesvanegmond committed Jun 1, 2017
2 parents 2d2fae1 + 944e808 commit 183c9d1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/CssInlinerPlugin.php
Expand Up @@ -84,7 +84,13 @@ public function loadOptions($options)
public function loadCssFilesFromLinks($message)
{
$dom = new \DOMDocument();
// set error level
$internalErrors = libxml_use_internal_errors(true);

$dom->loadHTML($message);

// Restore error level
libxml_use_internal_errors($internalErrors);
$link_tags = $dom->getElementsByTagName('link');

if ($link_tags->length > 0) {
Expand Down

0 comments on commit 183c9d1

Please sign in to comment.