From 107df692108e1b3b1a70bfd9f7697282ebfa9fc3 Mon Sep 17 00:00:00 2001 From: brettp Date: Thu, 15 Jul 2010 19:01:13 +0000 Subject: Fixes #2099. Added elgg_strip_tags() to allow plugins to remove extra formatting. git-svn-id: http://code.elgg.org/elgg/trunk@6718 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/output.php | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'engine') diff --git a/engine/lib/output.php b/engine/lib/output.php index 6e861e4ac..461f34057 100644 --- a/engine/lib/output.php +++ b/engine/lib/output.php @@ -1,7 +1,7 @@ $time)); } + +/** + * Strip tags and offer plugins the chance. + * Plugins register for output:strip_tags plugin hook. + * Original string included in $params['original_string'] + * + * @param string $string Formatted string + * @return string String run through strip_tags() and any plugin hooks. + */ +function elgg_strip_tags($string) { + $params['original_string'] = $string; + + $string = strip_tags($string); + $string = trigger_plugin_hook('output', 'strip_tags', $params, $string); + + return $string; +} \ No newline at end of file -- cgit v1.2.3