From 8d331b0f351cab61594991c339f44d5dca8096d5 Mon Sep 17 00:00:00 2001 From: hannes Date: Mon, 11 Jan 2016 20:54:19 +0000 Subject: [PATCH 1/2] EndCommonPurify event --- lib/util.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/util.php b/lib/util.php index 1d973d7100..c6951200b5 100644 --- a/lib/util.php +++ b/lib/util.php @@ -593,7 +593,10 @@ function common_purify($html) $html = common_remove_unicode_formatting($html); - return htmLawed($html, $config); + $purified = htmLawed($html, $config); + Event::handle('EndCommonPurify', array(&$purified)); + + return $purified; } function common_remove_unicode_formatting($text) @@ -2458,4 +2461,4 @@ function html_sprintf() function _ve($var) { return var_export($var, true); -} +} \ No newline at end of file From a1b509bb0b60f0d08b93ab3b210af829e468d4e0 Mon Sep 17 00:00:00 2001 From: hannes Date: Mon, 11 Jan 2016 20:58:34 +0000 Subject: [PATCH 2/2] forgot we need access to $html too --- lib/util.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util.php b/lib/util.php index c6951200b5..294c032216 100644 --- a/lib/util.php +++ b/lib/util.php @@ -594,7 +594,7 @@ function common_purify($html) $html = common_remove_unicode_formatting($html); $purified = htmLawed($html, $config); - Event::handle('EndCommonPurify', array(&$purified)); + Event::handle('EndCommonPurify', array(&$purified, $html)); return $purified; }