summaryrefslogtreecommitdiff
path: root/src/application/mystic/forum/utils/StringUtils.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/application/mystic/forum/utils/StringUtils.php')
-rw-r--r--src/application/mystic/forum/utils/StringUtils.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/application/mystic/forum/utils/StringUtils.php b/src/application/mystic/forum/utils/StringUtils.php
index fd38915..94221fb 100644
--- a/src/application/mystic/forum/utils/StringUtils.php
+++ b/src/application/mystic/forum/utils/StringUtils.php
@@ -23,6 +23,8 @@ final class StringUtils {
}
public static function truncate(string $str, int $maxLength, string $ellipsis = "…"): string {
+ if ($maxLength < 0)
+ return $str;
return mb_strimwidth($str, 0, $maxLength, $ellipsis);
}
}