• Resolved Nick Diego

    (@ndiego)


    Hi there,

    First off, awesome plugin. One of the few that works in the new Site Editor when placed outside of the main post content loop.

    I did run into a strange PHP warning. I did a bit of investigation and cannot seem to figure out why it is occurring.

    Warning: DOMDocument::loadHTML(): Empty string supplied as input in .../wp-content/plugins/simpletoc/plugin.php on line 221

    However, looking at the code on line 221, you could add a failsafe that would resolve this situation if it ever came up. Something like:

    function addAnchorAttribute($html){
    
      	// remove non-breaking space entites from input HTML
      	$html_wo_nbs = str_replace(" ", " ", $html);
    	
    	if ( ! $html_wo_nbs ) {
    		return $html;
    	}
    
    	...
    
    

    Anyway, just thought I would share. I have manually added the code above and everything works as expected. Thanks again for the plugin.

    Best,
    Nick

Viewing 12 replies - 1 through 12 (of 12 total)
Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘PHP Warning’ is closed to new replies.