This is a Drupal 7 back port of https://www.drupal.org/node/2511306

If you submit an empty DOMDocument object to filter_dom_serialize() It will cause drupal to white screen with an error: Call to a member function getElementsByTagName() in filter.module.

This checks the submitted DOMDocument object for valid data before attempting serialization to make sure we do not trip this error.

Comments

ElusiveMind created an issue. See original summary.

elusivemind’s picture

Status: Active » Needs review
StatusFileSize
new2.02 KB

Submitted sanity check and test case.

cilefen’s picture

I feel like I've seen this issue before, like it may be a duplicate. But I could be wrong.

elusivemind’s picture

It was reported and fixed in Drupal 8. The Drupal 7 patch never made it into Drupal 7 which is where the bug was originally found. It's also the source of much distress on some of code I inherited, so I'm trying to make sure this gets into Drupal 7. Just being thorough and diligent.

cilefen’s picture

Why isn't the other issue marked for backport?

cilefen’s picture

Status: Needs review » Closed (duplicate)

Status: Closed (duplicate) » Needs work
cilefen’s picture

That's all set - please post your latest patch on the original issue .

cilefen’s picture

Status: Needs work » Closed (duplicate)