From 66a33c75a5e5185f1640ec686beaf8349543fde8 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 4 Apr 2009 10:55:58 +0000 Subject: [PATCH] Fix infinite loop in truncate_string (Bug #43475) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9423 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_content.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index 1859941c76..c365b4d684 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -1129,7 +1129,7 @@ function truncate_string($string, $max_length = 60, $max_store_length = 255, $al array_pop($chars); $string = implode('', $chars); } - while (utf8_strlen($string) > $max_store_length || !sizeof($chars)); + while (!empty($char) && utf8_strlen($string) > $max_store_length); } if ($strip_reply)