yireo / Yireo_NextGenImages

44 stars 26 forks source link

Warning: DOMDocument::loadHTML(): Empty string supplied as input #51

Closed marcinfr closed 1 year ago

marcinfr commented 1 year ago

Hi,

Some of controllers can return empty string as html, for example: review/product/listAjax

In this case we have error 500 with error log: DOMDocument::loadHTML(): Empty string supplied as input.

I have fixed it in my project by plugin:

public function aroundReplace(\Yireo\NextGenImages\Util\HtmlReplacer $htmlReplacer, callable $proceed, string $html): string
{
    if ($html) {
        $html = $proceed($html);
    }

    return $html;
}
marcinfr commented 1 year ago

Now i see that its fixed in latest version. Thank You for Your work!

jissereitsma commented 1 year ago

:)