From 548820011a702f2bafc086fbe0da4836bb7f7175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 21 Feb 2021 13:39:59 +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 efe3824c5c4..3604308708b 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 : 1))) { + if (dol_strlen($newstring, $stringencoding) > ($size + ($nodot ? 0 : 2))) { // 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 : 1))) { + if (dol_strlen($newstring, $stringencoding) > ($size + ($nodot ? 0 : 2))) { // 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 {