aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-02-13 19:31:51 +0000
committerMario <mario@mariovavti.com>2022-02-13 19:31:51 +0000
commitc0350861ef0da66209e6b08c75af2c16e3673e25 (patch)
tree458473253ee91d92c7326b60567de301d272f4ea /include/text.php
parenta7ec1805e3f5836641503d1f8cb6ccc1d8c885fa (diff)
downloadvolse-hubzilla-c0350861ef0da66209e6b08c75af2c16e3673e25.tar.gz
volse-hubzilla-c0350861ef0da66209e6b08c75af2c16e3673e25.tar.bz2
volse-hubzilla-c0350861ef0da66209e6b08c75af2c16e3673e25.zip
php8 warnings
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]));