aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/text.php')
-rw-r--r--include/text.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/text.php b/include/text.php
index f69801302..9a2ca1af4 100644
--- a/include/text.php
+++ b/include/text.php
@@ -4057,9 +4057,10 @@ function sanitize_text_field($str) {
*/
function substr_words($str, $max_length, $suffix = '...') {
+ $ret = '';
+
if (strlen($str) > $max_length) {
$words = preg_split('/\s/', $str);
- $ret = '';
$i = 0;
while (true) {
$length = (strlen($ret) + strlen($words[$i]));