Skip to content

Commit 249d3f0

Browse files
authored
Merge pull request #5 from tvlooy/empty_html
avoid warning that html is empty
2 parents af32166 + f22c88e commit 249d3f0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/CssFromHTMLExtractor.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ protected function createDomDocumentFromHtml($html)
8686
{
8787
$document = new \DOMDocument('1.0', 'UTF-8');
8888
$internalErrors = libxml_use_internal_errors(true);
89-
$document->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8'));
89+
if (!empty($html)) {
90+
$document->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8'));
91+
}
9092
libxml_use_internal_errors($internalErrors);
9193
$document->formatOutput = true;
9294

0 commit comments

Comments
 (0)