summaryrefslogtreecommitdiff
path: root/includes/common.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/common.inc')
-rw-r--r--includes/common.inc6
1 files changed, 3 insertions, 3 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 020d0c5d8..6f4353e29 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -1831,7 +1831,7 @@ function drupal_convert_to_utf8($data, $encoding) {
* @return
* The truncated string.
*/
-function truncate_utf8($string, $len, $wordsafe = FALSE) {
+function truncate_utf8($string, $len, $wordsafe = FALSE, $dots = FALSE) {
$slen = strlen($string);
if ($slen <= $len) {
return $string;
@@ -1840,10 +1840,10 @@ function truncate_utf8($string, $len, $wordsafe = FALSE) {
while (($string[--$len] != ' ') && ($len > 0)) {};
}
if ((ord($string[$len]) < 0x80) || (ord($string[$len]) >= 0xC0)) {
- return substr($string, 0, $len);
+ return substr($string, 0, $len) . ($dots ? ' ...' : '');
}
while (ord($string[--$len]) < 0xC0) {};
- return substr($string, 0, $len);
+ return substr($string, 0, $len) . ($dots ? ' ...' : '');
}
/**