_filter_html
function _filter_html
_filter_html($text, $filter)
Implements callback_filter_process().
Provides filtering of input into accepted HTML.
Related topics
File
- modules/filter/filter.module, line 1303
- Framework for handling the filtering of content.
Code
function _filter_html($text, $filter) { $allowed_tags = preg_split('/\s+|<|>/', $filter->settings['allowed_html'], -1, PREG_SPLIT_NO_EMPTY); $text = filter_xss($text, $allowed_tags); if ($filter->settings['filter_html_nofollow']) { $html_dom = filter_dom_load($text); $links = $html_dom->getElementsByTagName('a'); foreach ($links as $link) { $link->setAttribute('rel', 'nofollow'); } $text = filter_dom_serialize($html_dom); } return trim($text); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!filter!filter.module/function/_filter_html/7.x