diff options
| author | Michael <savetheinternet@tinyboard.org> | 2013-06-18 10:45:13 -0700 |
|---|---|---|
| committer | Michael <savetheinternet@tinyboard.org> | 2013-06-18 10:45:13 -0700 |
| commit | 0ac9dd5f25ffd9969786567cf7f3081c39f4e0c7 (patch) | |
| tree | fd8e8bce38293493b1565147e1bbc3e3fdb7b875 /inc/display.php | |
| parent | cbc3bd0c0a13463dbdbc3d53a03dd9b2080496c4 (diff) | |
| parent | 399aa463b3d046a49c861a2c60c997f39af22561 (diff) | |
Merge pull request #115 from Macil/miscfixes
Miscellaneous fixes
Diffstat (limited to 'inc/display.php')
| -rw-r--r-- | inc/display.php | 4 |
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 ? '…' : '') . '</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>'; |
