• Resolved Jonathan Stegall

    (@jonathanstegall)


    I’ve noticed that whenever this plugin is used to send an email, I get the following PHP error:

    [php7:warn] [pid 23163] [client 127.0.0.1:46350] PHP Warning: DOMDocument::loadHTML(): Attribute xmlns redefined in Entity, line: 2 in /wp-content/plugins/lh-multipart-email/includes/Html2Text.php on line 127

    I’m using PHP 7.1.

    Where can I start to try to debug this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author shawfactor

    (@shawfactor)

    The problem is actually with some other plugin, that is defining an xmlns before my plugin filters the content and adds a plain text version to the email.

    Disable the other plugins until the rror goes away, you will then hve found the culprit

    Pete

    Thread Starter Jonathan Stegall

    (@jonathanstegall)

    I think I found the issue. In my email templates, I was adding a doctype like this:

    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="https://www.w3.org/1999/xhtml" xmlns="https://www.w3.org/1999/xhtml">
    

    Some email clients appear to like this (although of course many strip it out).

    If I change it to

    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    

    This seems to stop the error.

    Maybe it’s viable to use an HTML5 doctype in emails by now anyway. But in any case, that seems to be the cause of the error.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP DomDocument loadHTML error’ is closed to new replies.