You are here

function elf_filter_dom_load in External Links Filter 6.3

Using Drupal 7's filter_dom_load function which is not available in d6.

1 call to elf_filter_dom_load()
elf_replace in ./elf.module
Add classes to external or mailto links in a text.

File

./elf.module, line 209
Adds an icon to external and mailto links.

Code

function elf_filter_dom_load($text) {
  $dom_document = new DOMDocument();

  // Ignore warnings during HTML soup loading.
  @$dom_document
    ->loadHTML('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body>' . $text . '</body></html>');
  return $dom_document;
}