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; } } ?>