Skip to content

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

Closed
@salcode

Description

@salcode

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions