• I’m sporadically getting the following entry in debug.log:

    PHP Warning: DOMDocument::loadHTML(): Empty string supplied as input in /plugins/wp-seopress/inc/functions/sitemap/template-xml-sitemaps-single.php on line 137

Viewing 1 replies (of 1 total)
  • Plugin Author Benjamin Denis

    (@rainbowgeek)

    Hi,

    thank you for your feedback.

    Can you try to add this code in the file (/plugins/wp-seopress/inc/functions/sitemap/template-xml-sitemaps-single.php):

    at line 137, replace with this:

    							if ($post_content !="") {
    								if (function_exists('mb_convert_encoding')) {
    									$dom->loadHTML(mb_convert_encoding($post_content, 'HTML-ENTITIES', 'UTF-8'));
    								} else {
    									$dom->loadHTML('<?xml encoding="utf-8" ?>'.$post_content);
    								}
    
    								$dom->preserveWhiteSpace = false;
    
    								if ($dom->getElementsByTagName('img') !='') {
    									$images = $dom->getElementsByTagName('img');
    								}
    							}

    Save the file and let me know if you still see the warning.

    Hope it helps!

Viewing 1 replies (of 1 total)
  • The topic ‘PHP Warning: Empty string supplied as input’ is closed to new replies.