aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-01-31 19:04:17 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-01-31 19:04:17 +0000
commit3f58bd94b4092c95424391d9843c8c786ac87479 (patch)
tree38207d7cfae6ec9c7a8885554f7527616db16e70
parent669e3ecc1cf6564a80128b3d39f18a3b2a9fefcb (diff)
downloadelgg-3f58bd94b4092c95424391d9843c8c786ac87479.tar.gz
elgg-3f58bd94b4092c95424391d9843c8c786ac87479.tar.bz2
htmlawed no longer creates tags with extra spaces (<p >).
git-svn-id: http://code.elgg.org/elgg/trunk@3869 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--mod/htmlawed/start.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/mod/htmlawed/start.php b/mod/htmlawed/start.php
index d027fa34f..14e45a6d9 100644
--- a/mod/htmlawed/start.php
+++ b/mod/htmlawed/start.php
@@ -77,8 +77,12 @@ function htmlawed_hook($element, $attribute_array) {
}
}
- $string = trim($string);
- $r = "<$element $string>";
+ // some things (tinymce) don't like tags like <p > so make sure
+ // to only add a space if needed.
+ if ($string = trim($string)) {
+ $string = " $string";
+
+ $r = "<$element$string>";
return $r;
}
@@ -114,4 +118,4 @@ function htmlawed_filter_tags($hook, $entity_type, $returnvalue, $params) {
}
-register_elgg_event_handler('init', 'system', 'htmlawed_init'); \ No newline at end of file
+register_elgg_event_handler('init', 'system', 'htmlawed_init');