diff options
| author | Savetheinternet <savetheinternet@tinyboard.org> | 2011-10-08 21:01:26 +1100 |
|---|---|---|
| committer | Savetheinternet <savetheinternet@tinyboard.org> | 2011-10-08 21:01:26 +1100 |
| commit | ea2e4f12f83abb3a48accf1c739744aa009250d4 (patch) | |
| tree | 4953bfe26348fe88a7c371104035ffe7abe1d453 /inc | |
| parent | cf79aed4884ddf01e71e9cf91d7af216ab69c1f9 (diff) | |
pm_snippet bugfix (incorrectly double-escaped HTML entity)
Diffstat (limited to 'inc')
| -rw-r--r-- | inc/display.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/inc/display.php b/inc/display.php index fe33f4c1..5f4cae6f 100644 --- a/inc/display.php +++ b/inc/display.php @@ -116,10 +116,13 @@ // Unescape HTML characters, to avoid splitting them in half $body = html_entity_decode_utf8($body); - $body = substr($body, 0, $len) . (strlen($body) > $len ? '…' : ''); + // calculate strlen() so we can add "..." after if needed + $strlen = strlen($body); + + $body = substr($body, 0, $len); // Re-escape the characters. - return '<em>' . utf8tohtml($body) . '</em>'; + return '<em>' . utf8tohtml($body) . ($strlen > $len ? '…' : '') . '</em>'; } function capcode($cap) { |
