bradyvercher / gistpress

WordPress plugin to add Gist oEmbed and shortcode support with caching.
GNU General Public License v2.0
143 stars 28 forks source link

DOMDocument::loadHTML() Tag template invalid in Entity PHP Warning #81

Open salcode opened 10 months ago

salcode commented 10 months ago

When a Gist is retrieve from GitHub and parsed a PHP warning is thrown

DOMDocument::loadHTML() Tag template invalid in Entity

Note: Once the Gist is loaded in the transient, this does not occur again.

Expected Behavior

No warning is thrown, when loading the HTML for the Gist.

Current Behavior

A warning is thrown, when loading the HTML for the Gist.

DOMDocument::loadHTML() Tag template invalid in Entity

Possible Solution

Set

libxml_use_internal_errors(true);

see #80

Steps to Reproduce (for bugs)

  1. Enable PHP warnings
  2. Add a Gist to a post (e.g. https://gist.github.com/salcode/10017553)
  3. Save the post
  4. View the post on the front-end

image

Note: This behavior does NOT occur on page reload, because the output is now stored in a transient. You'll need to delete the transient (prefix gist_html_) to cause the warning again.