function word_filter_ob_callback($content) { if (!($user_wordfilter = word_filter_get_from_session())) { return word_filter_remove_ob_tags($content); } $pattern_array = $user_wordfilter['pattern_array']; $replace_array = $user_wordfilter['replace_array']; $pattern_match = sprintf('/<\\/?strip_%1$s>/u', $_SESSION['RAND_HASH']); $content_array = preg_split($pattern_match, $content); foreach ($content_array as $key => $content_match) { if ($key % 2 && ($new_content = @preg_replace($pattern_array, $replace_array, $content_match))) { $content_array[$key] = strip_tags($new_content); } } $content = implode('', $content_array); $pattern_match = sprintf('/<\\/?nostrip_%1$s>/u', $_SESSION['RAND_HASH']); $content_array = preg_split($pattern_match, $content); foreach ($content_array as $key => $content_match) { if ($key % 2 && ($new_content = @preg_replace($pattern_array, $replace_array, $content_match))) { $content_array[$key] = $new_content; } } $content = implode('', $content_array); return word_filter_remove_ob_tags($content); }
function word_filter_ob_callback($content) { if (($rand_hash = session::get_value('RAND_HASH')) === false) { return word_filter_remove_ob_tags($content); } $rand_hash = preg_replace("/[^a-z]/iu", "", $rand_hash); if (!($user_wordfilter = word_filter_get_from_session())) { return word_filter_remove_ob_tags($content); } $pattern_array = $user_wordfilter['pattern_array']; $replace_array = $user_wordfilter['replace_array']; $pattern_match = sprintf('/<\\/?strip_%1$s>/u', $rand_hash); $content_array = preg_split($pattern_match, $content); foreach ($content_array as $key => $content_match) { if ($key % 2 && ($new_content = @preg_replace($pattern_array, $replace_array, $content_match))) { $content_array[$key] = strip_tags($new_content); } } $content = implode('', $content_array); $pattern_match = sprintf('/<\\/?nostrip_%1$s>/u', $rand_hash); $content_array = preg_split($pattern_match, $content); foreach ($content_array as $key => $content_match) { if ($key % 2 && ($new_content = @preg_replace($pattern_array, $replace_array, $content_match))) { $content_array[$key] = $new_content; } } $content = implode('', $content_array); return word_filter_remove_ob_tags($content); }
function pm_display_html_export($message_data) { ob_start(); pm_display($message_data, true, true); $pm_message_html = ob_get_contents(); ob_end_clean(); return word_filter_remove_ob_tags($pm_message_html); }