aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Rodríguez Pérez <Miguel.Rodriguez@det.uvigo.es>2012-07-10 17:09:35 +0200
committerMiguel Rodríguez Pérez <Miguel.Rodriguez@det.uvigo.es>2012-07-10 17:12:18 +0200
commit894481db371b3dd25be115275b7254c68eb85542 (patch)
tree81ade5e799a620e4a99948f8fff1f1174a352947
parent3fd34b8af5777226fdd503eb3646d57af0310fab (diff)
downloadelgg-894481db371b3dd25be115275b7254c68eb85542.tar.gz
elgg-894481db371b3dd25be115275b7254c68eb85542.tar.bz2
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.
-rw-r--r--mod/htmlawed/start.php8
1 files changed, 7 insertions, 1 deletions
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 "</${element}>";
+ }
+
// these are the default styles used by tinymce.
$allowed_styles = array(
'color', 'cursor', 'text-align', 'vertical-align', 'font-size',