summaryrefslogtreecommitdiff
path: root/inc/display.php
diff options
context:
space:
mode:
authorMichael <savetheinternet@tinyboard.org>2013-06-18 10:45:13 -0700
committerMichael <savetheinternet@tinyboard.org>2013-06-18 10:45:13 -0700
commit0ac9dd5f25ffd9969786567cf7f3081c39f4e0c7 (patch)
treefd8e8bce38293493b1565147e1bbc3e3fdb7b875 /inc/display.php
parentcbc3bd0c0a13463dbdbc3d53a03dd9b2080496c4 (diff)
parent399aa463b3d046a49c861a2c60c997f39af22561 (diff)
Merge pull request #115 from Macil/miscfixes
Miscellaneous fixes
Diffstat (limited to 'inc/display.php')
-rw-r--r--inc/display.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/inc/display.php b/inc/display.php
index ab96eb26..5395edcc 100644
--- a/inc/display.php
+++ b/inc/display.php
@@ -118,7 +118,7 @@ function pm_snippet($body, $len=null) {
// calculate strlen() so we can add "..." after if needed
$strlen = mb_strlen($body);
- $body = substr($body, 0, $len);
+ $body = mb_substr($body, 0, $len);
// Re-escape the characters.
return '<em>' . utf8tohtml($body) . ($strlen > $len ? '&hellip;' : '') . '</em>';
@@ -204,7 +204,7 @@ function truncate($body, $url, $max_lines = false, $max_chars = false) {
}
} else {
// remove broken HTML entity at the end (if existent)
- $body = preg_replace('/&[^;]+$/', '', $body);
+ $body = preg_replace('/&[^;]*$/', '', $body);
}
$body .= '<span class="toolong">Post too long. Click <a href="' . $url . '">here</a> to view the full text.</span>';