From 5d502aa7d180284806a16bf2b75cdd5225053290 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 Jun 2012 00:15:30 +0200 Subject: [PATCH] Fix: function dol_nboflines_bis --- htdocs/core/lib/functions.lib.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d7ae1cd1440..34e3d32fe3e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3262,9 +3262,10 @@ function dol_nboflines_bis($text,$maxlinesize=0,$charset='UTF-8') if (dol_textishtml($text)) $repTable = array("\t" => " ", "\n" => " ", "\r" => " ", "\0" => " ", "\x0B" => " "); $text = strtr($text, $repTable); - if ($charset == 'UTF-8') { $pattern = '/(<[^>]+>)/Uu'; } // /U is to have UNGREEDY regex to limit to one html tag. /u is for UTF8 support - else $pattern = '/(<[^>]+>)/U'; // /U is to have UNGREEDY regex to limit to one html tag. + if ($charset == 'UTF-8') { $pattern = '/(]*>)/Uu'; } // /U is to have UNGREEDY regex to limit to one html tag. /u is for UTF8 support + else $pattern = '/(]*>)/U'; // /U is to have UNGREEDY regex to limit to one html tag. $a = preg_split($pattern, $text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); + $nblines = floor((count($a)+1)/2); // count possible auto line breaks if($maxlinesize)