forked from Wavyzz/dolibarr
Removed PHP 5.3 comparison in dol_nl2br function
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user