From e1e35281f16804e8840b45111c9ac65a6f1b6881 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 1 May 2011 10:34:18 +0000 Subject: [PATCH] Try to fix a lot of regression. Add also more phpunit test to avoid them in future. --- htdocs/lib/functions.lib.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index 52d3d30ea9b..7f89ad17019 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -3064,10 +3064,7 @@ function dol_nl2br($stringtoencode,$nl2brmode=0,$forxml=false) } else { - $ret=str_replace("\r","",$stringtoencode); - $ret=str_replace("\n",($forxml?'
':'
'),$ret); - //$ret=preg_replace('/(
||)\s*(\r\n|\r|\n)+/i',($forxml?'
':'
'),$stringtoencode); - //$ret=preg_replace('/([^]+)(\r\n|\r|\n)+/i',($forxml?'$1
':'$1
'),$ret); + $ret=preg_replace('/(\r\n|\r|\n)/i',($forxml?'
':'
'),$stringtoencode); return $ret; } }