summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorMacil Tech <maciltech@gmail.com>2012-08-16 09:05:19 -0500
committerMacil Tech <maciltech@gmail.com>2013-01-18 18:26:25 -0600
commit46f50248f01c03bb4fefd181c5e5ac594fac4774 (patch)
treed8828f841f161aa46b556ec1aeba5e7f50f492f1 /inc
parentdf667896cddfedaa4bf228fbb321bb1195cd9345 (diff)
Don't require closing tag for tags that don't need it.
Diffstat (limited to 'inc')
-rw-r--r--inc/display.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/inc/display.php b/inc/display.php
index 264fde60..6394c711 100644
--- a/inc/display.php
+++ b/inc/display.php
@@ -190,9 +190,12 @@ function truncate($body, $url, $max_lines = false, $max_chars = false) {
// remove broken HTML entity at the end (if existent)
$body = preg_replace('/&[^;]+$/', '', $body);
+ $tags_no_close_needed = array("colgroup", "dd", "dt", "li", "optgroup", "option", "p", "tbody", "td", "tfoot", "th", "thead", "tr", "br", "img");
+
// Close any open tags
foreach ($tags as &$tag) {
- $body .= "</{$tag}>";
+ if (!in_array($tag, $tags_no_close_needed))
+ $body .= "</{$tag}>";
}
} else {
// remove broken HTML entity at the end (if existent)