diff --git a/core/model/fieldtypes/HTMLText.php b/core/model/fieldtypes/HTMLText.php
index 93f089366..80483fb3f 100755
--- a/core/model/fieldtypes/HTMLText.php
+++ b/core/model/fieldtypes/HTMLText.php
@@ -55,13 +55,17 @@ class HTMLText extends Text {
$summary .= $parts[$pIndex++] . ' ';
}
-
+ // Tags that shouldn't be closed
+ $noClose = array("br", "img");
// make sure that the summary is well formed XHTML by closing tags
while( $openTag = array_pop( $tagStack ) ) {
preg_match( '/^<(\w+)\s+/', $openTag, $tagName );
- if(sizeof($tagName) > 0)
- $summary .= "{$tagName[1]}>";
+ if(sizeof($tagName) > 0) {
+ if(!in_array($tagName[1], $noClose)) {
+ $summary .= "{$tagName[1]}>";
+ }
+ }
}
return $summary;