From 0512b39ec3f51182f79e134c710392ff5acb9298 Mon Sep 17 00:00:00 2001 From: Manfred Kindl Date: Mon, 20 Nov 2017 20:06:03 +0100 Subject: [PATCH] Bugfix Function cutString --- include/functions.inc.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/functions.inc.php b/include/functions.inc.php index 5fc5e5418..d63aa8f5f 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -1062,6 +1062,10 @@ function cutString($string, $limit, $placeholderSign = '', $keepFilextension = f $extension = '.'.pathinfo($string, PATHINFO_EXTENSION); $offset = $offset + strlen($extension); } + if(($limit - $offset) < 0) + { + return '$placeholderSign must not be shorter than $limit'; + } if(strlen($string) > ($limit - $offset)) { @@ -1069,7 +1073,7 @@ function cutString($string, $limit, $placeholderSign = '', $keepFilextension = f } else { - return false; + return $string; } } ?>