(cp fc5bc47bc) fixes #1960 custom pwg_nl2br to avoid warning on PHP 8.1+

This commit is contained in:
plegall
2024-12-18 12:30:05 +01:00
parent ae603c6a1d
commit 945c0991ef
3 changed files with 16 additions and 11 deletions
+15
View File
@@ -710,4 +710,19 @@ function flush_page_messages()
}
}
/**
* pwg_nl2br is useful for PHP 5.2 which doesn't accept more than 1
* parameter on nl2br() (and anyway the second parameter of nl2br does not
* match what Piwigo gives.
*/
function pwg_nl2br($string)
{
if (empty($string))
{
return $string;
}
return nl2br($string);
}
?>