echo_safe_html
The NextGEN Gallery echo safe html function.
Description
Parameters (2)
- 0. $html
- The html.
- 1. $extra_tags — Optional. (constant) =>
null
- The extra tags.
Usage
if ( !function_exists( 'echo_safe_html' ) ) { require_once ABSPATH . PLUGINDIR . 'nextgen-gallery/products/photocrati_nextgen/modules/mvc/module.mvc.php'; } // The html. $html = null; // The extra tags. $extra_tags = null; // NOTICE! Understand what this does before running. $result = echo_safe_html($html, $extra_tags);
Defined (1)
The function is defined in the following location(s).
- /products/photocrati_nextgen/modules/mvc/module.mvc.php
- function echo_safe_html($html, $extra_tags = null)
- {
- $tags = array('<a>', '<abbr>', '<acronym>', '<address>', '<b>', '<base>', '<basefont>', '<big>', '<blockquote>', '<br>', '<br/>', '<caption>', '<center>', '<cite>', '<code>', '<col>', '<colgroup>', '<dd>', '<del>', '<dfn>', '<dir>', '<div>', '<dl>', '<dt>', '<em>', '<fieldset>', '<font>', '<h1>', '<h2>', '<h3>', '<h4>', '<h5>', '<h6>', '<hr>', '<i>', '<ins>', '<label>', '<legend>', '<li>', '<menu>', '<noframes>', '<noscript>', '<ol>', '<optgroup>', '<option>', '<p>', '<pre>', '<q>', '<s>', '<samp>', '<select>', '<small>', '<span>', '<strike>', '<strong>', '<sub>', '<sup>', '<table>', '<tbody>', '<td>', '<tfoot>', '<th>', '<thead>', '<tr>', '<tt>', '<u>', '<ul>');
- $html = preg_replace('/\\s+on\\w+=(["\']).*?\\1/i', '', $html);
- $html = preg_replace('/(<\/[^>]+?>)(<[^>\/][^>]*?>)/', '$1 $2', $html);
- $html = strip_tags($html, implode('', $tags));
- echo $html;
- }