From d7fa3e08028acf1dc4b00bea656c80f34db31acc Mon Sep 17 00:00:00 2001 From: andrey Date: Tue, 30 Jan 2001 17:41:48 +0000 Subject: [PATCH] *** empty log message *** --- Smarty.addons.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Smarty.addons.php b/Smarty.addons.php index d9f4f675..5d9b23bb 100644 --- a/Smarty.addons.php +++ b/Smarty.addons.php @@ -86,6 +86,9 @@ function smarty_mod_escape($string, $esc_type = 'html') \*======================================================================*/ function smarty_mod_truncate($string, $length = 80, $etc = '...', $break_words = false) { + if ($length == 0) + return ''; + if (strlen($string) > $length) { $length -= strlen($etc); $fragment = substr($string, 0, $length+1);