From 00000dbeee6def5bc634f1ef1213431c6412e3f5 Mon Sep 17 00:00:00 2001 From: leithoff Date: Tue, 24 May 2016 16:00:59 +0200 Subject: [PATCH] mind namespace when calling hook_tag function --- api/src/Html/HtmLawed.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/api/src/Html/HtmLawed.php b/api/src/Html/HtmLawed.php index bf7c9381f5..8125e8f599 100644 --- a/api/src/Html/HtmLawed.php +++ b/api/src/Html/HtmLawed.php @@ -118,7 +118,13 @@ class HtmLawed // we allow filtered style sections now throughout egroupware /*if ($Config['hook_tag'] =="hl_email_tag_transform")*/ $styles = self::getStyles($html2check); //error_log(__METHOD__.__LINE__.array2string($styles)); + //error_log(__METHOD__.__LINE__.' Config:'.array2string($Config)); + // mind our namespace when defining a function as hook. we handle our own defined hooks here. + if ($Config['hook_tag']=="hl_my_tag_transform" || $Config['hook_tag']=="hl_email_tag_transform") + { + $Config['hook_tag']=__NAMESPACE__.'\\'.$Config['hook_tag']; + } return ($styles?$styles:'').htmLawed($html2check, $Config, $Spec); } @@ -335,7 +341,7 @@ function hl_my_tag_transform($element, $attribute_array=0) */ function hl_email_tag_transform($element, $attribute_array=0) { - //error_log(__METHOD__.__LINE__.$element.array2string($attribute_array)); + //error_log(__METHOD__.__LINE__.$element.'=>'.array2string($attribute_array)); static $lastelement = null; static $throwawaycounter = null; if (is_null($lastelement)) $lastelement='';