echo_safe_html

The NextGEN Gallery echo safe html function.

Description

echo_safe_html( $html, (constant) $extra_tags = null ); 

Parameters (2)

0. $html
The html.
1. $extra_tags — Optional. (constant) => null
The extra tags.

Usage

  1. if ( !function_exists( 'echo_safe_html' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'nextgen-gallery/products/photocrati_nextgen/modules/mvc/module.mvc.php'; 
  3.  
  4. // The html. 
  5. $html = null; 
  6.  
  7. // The extra tags. 
  8. $extra_tags = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = echo_safe_html($html, $extra_tags); 
  12.  

Defined (1)

The function is defined in the following location(s).

/products/photocrati_nextgen/modules/mvc/module.mvc.php  
  1. function echo_safe_html($html, $extra_tags = null) 
  2. $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>'); 
  3. $html = preg_replace('/\\s+on\\w+=(["\']).*?\\1/i', '', $html); 
  4. $html = preg_replace('/(<\/[^>]+?>)(<[^>\/][^>]*?>)/', '$1 $2', $html); 
  5. $html = strip_tags($html, implode('', $tags)); 
  6. echo $html;