Avoid HTML parsing of an empty body

This commit is contained in:
Michael 2021-04-10 05:46:19 +00:00
parent 3e2fa7867c
commit 5a00902e11
7 changed files with 26 additions and 9 deletions

View file

@ -1475,6 +1475,10 @@ class GServer
*/
private static function analyseRootBody($curlResult, array $serverdata, string $url)
{
if (empty($curlResult->getBody())) {
return $serverdata;
}
$doc = new DOMDocument();
@$doc->loadHTML($curlResult->getBody());
$xpath = new DOMXPath($doc);