From 71d32a7422c779d03d89ab07b60b742bdfaa2bc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 21 Feb 2021 15:59:19 +0100 Subject: [PATCH] fix tests --- htdocs/core/lib/functions.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 128f6ffff16..a0533608020 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3202,7 +3202,7 @@ function dol_trunc($string, $size = 40, $trunc = 'right', $stringencoding = 'UTF // We go always here if ($trunc == 'right') { $newstring = dol_textishtml($string) ? dol_string_nohtmltag($string, 1) : $string; - if (dol_strlen($newstring, $stringencoding) > ($size + ($nodot ? 0 : 3))) { + if (dol_strlen($newstring, $stringencoding) > ($size + ($nodot ? 0 : 1))) { // If nodot is 0 and size is 1 chars more, we don't trunc and don't add … return dol_substr($newstring, 0, $size, $stringencoding).($nodot ? '' : '…'); } else { @@ -3220,7 +3220,7 @@ function dol_trunc($string, $size = 40, $trunc = 'right', $stringencoding = 'UTF } } elseif ($trunc == 'left') { $newstring = dol_textishtml($string) ? dol_string_nohtmltag($string, 1) : $string; - if (dol_strlen($newstring, $stringencoding) > ($size + ($nodot ? 0 : 3))) { + if (dol_strlen($newstring, $stringencoding) > ($size + ($nodot ? 0 : 1))) { // If nodot is 0 and size is 1 chars more, we don't trunc and don't add … return '…'.dol_substr($newstring, dol_strlen($newstring, $stringencoding) - $size, $size, $stringencoding); } else {