Title: Php errors (DOMDocument::loadHTML())
Last modified: February 27, 2024

---

# Php errors (DOMDocument::loadHTML())

 *  [gaet](https://wordpress.org/support/users/gaet/)
 * (@gaet)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/php-errors-domdocumentloadhtml/)
 * Hi,
   I’ve some php errors detected by Query Monitor plugin.Errors are :
 *     ```wp-block-code
       DOMDocument::loadHTML(): Tag header invalid in Entity
       DOMDocument::loadHTML(): Tag nav invalid in Entity
       DOMDocument::loadHTML(): htmlParseEntityRef: no name in Entity
   
       wp-content/plugins/email-encoder-bundle/core/includes/classes/class-email-encoder-bundle-validate.php:409
       ```
   
 * Can you tell me how to fix it ?
 * Thanks

Viewing 10 replies - 1 through 10 (of 10 total)

 *  [pycroy](https://wordpress.org/support/users/pycroy/)
 * (@pycroy)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/php-errors-domdocumentloadhtml/#post-17503766)
 * Same here get errors :
 *     ```wp-block-code
       E_WARNING: DOMDocument::loadHTML(): Unexpected end tag : transition in Entity, line: 1906 in /wp-content/plugins/email-encoder-bundle/core/includes/classes/class-email-encoder-bundle-validate.php on line 409
       ```
   
 *  [pycroy](https://wordpress.org/support/users/pycroy/)
 * (@pycroy)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/php-errors-domdocumentloadhtml/#post-17534910)
 * Same here my log file full of this
 * `E_WARNING: DOMDocument::loadHTML(): Unexpected end tag : div in Entity, line:
   2034 in /wp-content/plugins/email-encoder-bundle/core/includes/classes/class-
   email-encoder-bundle-validate.php on line 409`
 *  [thamrin0](https://wordpress.org/support/users/thamrin0/)
 * (@thamrin0)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/php-errors-domdocumentloadhtml/#post-17689468)
 * /email-encoder-bundle/core/includes/classes/class-email-encoder-bundle-validate.
   php
 * When I load an HTML5 page, I get a php error on line 409.
 * @$dom->loadHTML($content);
 * You should be able to suppress errors with libxml_use_internal_errors and libxml_clear_errors
   before and after loadHTML.
 *  [thamrin0](https://wordpress.org/support/users/thamrin0/)
 * (@thamrin0)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/php-errors-domdocumentloadhtml/#post-17689655)
 * Here is a page written in Japanese, but it is helpful.
 * [https://tabiji.gallery/development/5311](https://tabiji.gallery/development/5311)
 *  [Marcus Quinn](https://wordpress.org/support/users/surferking/)
 * (@surferking)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/php-errors-domdocumentloadhtml/#post-17881505)
 * Did this ever get fixed?
 *  [pycroy](https://wordpress.org/support/users/pycroy/)
 * (@pycroy)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/php-errors-domdocumentloadhtml/#post-17881508)
 * Not for me…
 *  [Marcus Quinn](https://wordpress.org/support/users/surferking/)
 * (@surferking)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/php-errors-domdocumentloadhtml/#post-17882023)
 * Yeah, I see dozens of errors on every page loading. I wonder if it’s conflicting
   with Query Monitor?
 *  [thamrin0](https://wordpress.org/support/users/thamrin0/)
 * (@thamrin0)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/php-errors-domdocumentloadhtml/#post-17882362)
 * I rewrote class-email-encoder-bundle-validate.php and no more errors.
   I am not
   sure if the Query Monitor is the cause.
 * line408-409
 *     ```wp-block-code
                   $dom = new DOMDocument();            @$dom->loadHTML($content);
       ```
   
 *     ```wp-block-code
                   $dom = new DOMDocument();  $internalErrors = libxml_use_internal_errors(true);                @$dom->loadHTML($content);
       ```
   
 * line440-442
 *     ```wp-block-code
                   }
   
                   //Keep for now
       ```
   
 *     ```wp-block-code
                                   }libxml_use_internal_errors($internalErrors);libxml_clear_errors();                        //Keep for now
       ```
   
 *  [Marcus Quinn](https://wordpress.org/support/users/surferking/)
 * (@surferking)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/php-errors-domdocumentloadhtml/#post-17883395)
 * [@ironikus](https://wordpress.org/support/users/ironikus/) What do you think 
   of the above patch? 👆
 *  [pycroy](https://wordpress.org/support/users/pycroy/)
 * (@pycroy)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/php-errors-domdocumentloadhtml/#post-17883422)
 * [@thamrin0](https://wordpress.org/support/users/thamrin0/) for me working great!
   Thanks

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Php errors (DOMDocument::loadHTML())’ is closed to new replies.

 * ![](https://ps.w.org/email-encoder-bundle/assets/icon-256x256.png?rev=2056506)
 * [Email Encoder - Protect Email Addresses and Phone Numbers](https://wordpress.org/plugins/email-encoder-bundle/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/email-encoder-bundle/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/email-encoder-bundle/)
 * [Active Topics](https://wordpress.org/support/plugin/email-encoder-bundle/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/email-encoder-bundle/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/email-encoder-bundle/reviews/)

 * 10 replies
 * 4 participants
 * Last reply from: [pycroy](https://wordpress.org/support/users/pycroy/)
 * Last activity: [1 year, 10 months ago](https://wordpress.org/support/topic/php-errors-domdocumentloadhtml/#post-17883422)
 * Status: not resolved