Skip to content

Commit f8367eb

Browse files
committed
Fix deprecated libxml_disable_entity_loader
1 parent 05a37d6 commit f8367eb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Crawler.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,7 +1184,9 @@ private function parseXhtml(string $htmlContent, string $charset = 'UTF-8'): \DO
11841184
$htmlContent = $this->convertToHtmlEntities($htmlContent, $charset);
11851185

11861186
$internalErrors = libxml_use_internal_errors(true);
1187-
$disableEntities = libxml_disable_entity_loader(true);
1187+
if (LIBXML_VERSION < 20900) {
1188+
$disableEntities = libxml_disable_entity_loader(true);
1189+
}
11881190

11891191
$dom = new \DOMDocument('1.0', $charset);
11901192
$dom->validateOnParse = true;
@@ -1194,7 +1196,9 @@ private function parseXhtml(string $htmlContent, string $charset = 'UTF-8'): \DO
11941196
}
11951197

11961198
libxml_use_internal_errors($internalErrors);
1197-
libxml_disable_entity_loader($disableEntities);
1199+
if (LIBXML_VERSION < 20900) {
1200+
libxml_disable_entity_loader($disableEntities);
1201+
}
11981202

11991203
return $dom;
12001204
}

0 commit comments

Comments
 (0)