2
0
forked from Wavyzz/dolibarr

Removed PHP 5.3 comparison in dol_nl2br function

This commit is contained in:
Marcos García de La Fuente
2014-07-22 04:07:33 +02:00
parent a6275181ec
commit 9b3e65d80f

View File

@@ -3629,14 +3629,10 @@ function dol_string_nohtmltag($StringHtml,$removelinefeed=1,$pagecodeto='UTF-8')
*/ */
function dol_nl2br($stringtoencode,$nl2brmode=0,$forxml=false) function dol_nl2br($stringtoencode,$nl2brmode=0,$forxml=false)
{ {
if (! $nl2brmode) if (!$nl2brmode) {
{ return nl2br($stringtoencode, $forxml);
if (version_compare(PHP_VERSION, '5.3.0') < 0) return nl2br($stringtoencode); } else {
else return nl2br($stringtoencode,$forxml); $ret=preg_replace('/(\r\n|\r|\n)/i', ($forxml?'<br />':'<br>'), $stringtoencode);
}
else
{
$ret=preg_replace('/(\r\n|\r|\n)/i',($forxml?'<br />':'<br>'),$stringtoencode);
return $ret; return $ret;
} }
} }