Instead of
$dom = new DOMDocument();
$dom->loadHTML($string);
I think the proper approach is to use Drupal's filter_dom_load() in order to properly convert ampersands, en dashes and such.
$dom = filter_dom_load($string);
Without this change, I'm seeing weird characters in the filtered HTML.
Patch to follow.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | iframeremove-use_drupal_dom_loader-2974802-2.patch | 642 bytes | othermachines |
Comments
Comment #2
othermachines commentedPatch.
Comment #4
yookoala commentedComment #5
yookoala commented