Title: incorrect &#8220;loadHtml&#8221;
Last modified: February 7, 2019

---

# incorrect “loadHtml”

 *  Resolved [Тони К](https://wordpress.org/support/users/catloki/)
 * (@catloki)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/incorrect-loadhtml/)
 * Hi! (PHP 7.1, WP 5.03)
 * function linkify (in file mgcl_core.php)
 * $html->loadHtml( $buffer, 0 );
 * need to fix on
 * $html->loadHtml( $buffer, **LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD** );
 * otherwise:
 *     ```
       <div class="entry-content clearfix"><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
       <html><body>...
       ```
   

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

 *  Thread Starter [Тони К](https://wordpress.org/support/users/catloki/)
 * (@catloki)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/incorrect-loadhtml/#post-11180495)
 * P.S. I’m sorry, I know english bad
 *  Plugin Author [Jordy Meow](https://wordpress.org/support/users/tigroumeow/)
 * (@tigroumeow)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/incorrect-loadhtml/#post-11182047)
 * Hi,
 * Yes, you are right, that’s what I was doing before but unfortunately those constants
   don’t exist on former versions of PHP and I went for the easy way.
 * Anyway, I will use this code from now 🙂
 *     ```
       if ( defined( 'LIBXML_HTML_NOIMPLIED' ) && defined( 'LIBXML_HTML_NODEFDTD' ) )
         $html->loadHtml( $buffer, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD );
       else
         $html->loadHtml( $buffer, 0 );
       ```
   
    -  This reply was modified 7 years, 2 months ago by [Jordy Meow](https://wordpress.org/support/users/tigroumeow/).
 *  Thread Starter [Тони К](https://wordpress.org/support/users/catloki/)
 * (@catloki)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/incorrect-loadhtml/#post-11182682)
 * thank

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

The topic ‘incorrect “loadHtml”’ is closed to new replies.

 * ![](https://ps.w.org/gallery-custom-links/assets/icon-256x256.png?rev=2588900)
 * [Gallery Custom Links](https://wordpress.org/plugins/gallery-custom-links/)
 * [Support Threads](https://wordpress.org/support/plugin/gallery-custom-links/)
 * [Active Topics](https://wordpress.org/support/plugin/gallery-custom-links/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gallery-custom-links/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gallery-custom-links/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Тони К](https://wordpress.org/support/users/catloki/)
 * Last activity: [7 years, 2 months ago](https://wordpress.org/support/topic/incorrect-loadhtml/#post-11182682)
 * Status: resolved