From 894481db371b3dd25be115275b7254c68eb85542 Mon Sep 17 00:00:00 2001 From: Miguel Rodríguez Pérez Date: Tue, 10 Jul 2012 17:09:35 +0200 Subject: Prevent inserting duplicated tags When htmlawed_tag_post_processor gets called, we check $attributed to be passed. If it is not, then it is a closing tag. Return it without further processing. --- mod/htmlawed/start.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mod/htmlawed/start.php b/mod/htmlawed/start.php index b52a390bb..12b6470a3 100644 --- a/mod/htmlawed/start.php +++ b/mod/htmlawed/start.php @@ -92,7 +92,13 @@ function htmLawedArray(&$v, $k, $htmlawed_config) { * @param array $attributes An array of attributes * @return string */ -function htmlawed_tag_post_processor($element, $attributes = array()) { +function htmlawed_tag_post_processor($element, $attributes = false) { + if ($attributes === false) { + // This is a closing tag. Prevent further processing to avoid inserting a duplicate tag + + return ""; + } + // these are the default styles used by tinymce. $allowed_styles = array( 'color', 'cursor', 'text-align', 'vertical-align', 'font-size', -- cgit v1.2.3