From 225c88b83e9b4f6e81d9b436561e7517be9a55d2 Mon Sep 17 00:00:00 2001 From: Boone B Gorges Date: Thu, 27 Mar 2014 15:46:28 -0400 Subject: [PATCH] Move ass_clean_content() cleanup routines to apply_filters() callbacks This way they can be removed one-by-one --- bp-activity-subscription-functions.php | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/bp-activity-subscription-functions.php b/bp-activity-subscription-functions.php index d41fc73..2077bb3 100644 --- a/bp-activity-subscription-functions.php +++ b/bp-activity-subscription-functions.php @@ -1381,10 +1381,23 @@ function ass_get_group_admins_mods( $group_id ) { * @return string $clean_content The email content, cleaned up for plaintext email */ function ass_clean_content( $content ) { - $clean_content = stripslashes( $content ); - $clean_content = ass_convert_links( $clean_content ); - $clean_content = html_entity_decode( $clean_content, ENT_QUOTES ); - return apply_filters( 'ass_clean_content', $clean_content, $content ); + return apply_filters( 'ass_clean_content', $content ); +} + +// By default, we run content through these filters, which can be individually removed +add_filter( 'ass_clean_content', 'stripslashes', 2 ); +add_filter( 'ass_clean_content', 'strip_tags', 4 ); +add_filter( 'ass_clean_content', 'ass_convert_links', 6 ); +add_filter( 'ass_clean_content', 'ass_html_entity_decode', 8 ); + +/** + * Wrapper for html_entity_decode() that can be used as an apply_filters() callback + * + * @param string + * @return string + */ +function ass_html_entity_decode( $content ) { + return html_entity_decode( $content, ENT_QUOTES ); } /**