diff -r ec7f8f6312bb -r 4125e19d3b27 includes/render.php --- a/includes/render.php Mon Feb 01 02:14:02 2010 -0500 +++ b/includes/render.php Mon Feb 01 02:15:04 2010 -0500 @@ -351,6 +351,32 @@ } /** + * Strip out an arbitrary HTML tag, pushing on to the existing list of stripped data. + * @access private + */ + + public static function tag_strip_push($tag, &$text, &$stripdata) + { + if ( !is_array($stripdata) ) + { + $stripdata = array( + 'random_id' => md5( time() . mt_rand() ), + 'blocks' => array() + ); + } + $random_id =& $stripdata['random_id']; + + preg_match_all("#<$tag>(.*?)#is", $text, $blocks); + + foreach ( $blocks[0] as $i => $match ) + { + $j = count($stripdata['blocks']); + $stripdata['blocks'][] = $blocks[1][$i]; + $text = str_replace($match, "{{$tag}:{$random_id}:{$j}}", $text); + } + } + + /** * Restore stripped tags. * @access private */