Skip to content

Commit 183c9d1

Browse files
Merge pull request #43 from Belphemur/patch-1
Avoid problem with HTML with fault
2 parents 2d2fae1 + 944e808 commit 183c9d1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/CssInlinerPlugin.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,13 @@ public function loadOptions($options)
8484
public function loadCssFilesFromLinks($message)
8585
{
8686
$dom = new \DOMDocument();
87+
// set error level
88+
$internalErrors = libxml_use_internal_errors(true);
89+
8790
$dom->loadHTML($message);
91+
92+
// Restore error level
93+
libxml_use_internal_errors($internalErrors);
8894
$link_tags = $dom->getElementsByTagName('link');
8995

9096
if ($link_tags->length > 0) {

0 commit comments

Comments
 (0)