N°4517 - PHP 8.1: Fix deprecated notice for null value passed to string parameter of native PHP functions

This commit is contained in:
Molkobain
2022-05-18 20:03:00 +02:00
committed by acognet
parent 09b0ac38ef
commit 7dc4a2776b
3 changed files with 3 additions and 3 deletions

View File

@@ -298,7 +298,7 @@ EOF
$sHTMLValue .= "<input class=\"field_autocomplete ibo-input ibo-input-select ibo-input-select-autocomplete\" type=\"text\" id=\"label_$this->iId\" value=\"$sDisplayValue\" placeholder='...'/>";
// another hidden input to store & pass the object's Id
$sHTMLValue .= "<input type=\"hidden\" id=\"$this->iId\" name=\"{$sAttrFieldPrefix}{$sFieldName}\" value=\"".htmlentities($value, ENT_QUOTES, 'UTF-8')."\" />\n";
$sHTMLValue .= "<input type=\"hidden\" id=\"$this->iId\" name=\"{$sAttrFieldPrefix}{$sFieldName}\" value=\"".utils::HtmlEntities($value)."\" />\n";
$JSSearchMode = $this->bSearchMode ? 'true' : 'false';
// Scripts to start the autocomplete and bind some events to it

View File

@@ -1827,7 +1827,7 @@ class utils
*/
public static function HtmlEntities($sValue)
{
return htmlentities($sValue, ENT_QUOTES, 'UTF-8');
return htmlentities($sValue ?? '', ENT_QUOTES, 'UTF-8');
}
/**

View File

@@ -242,7 +242,7 @@ class ormStopWatch
foreach ($aProperties as $sProperty => $sValue)
{
$sRes .= "<TR>";
$sCell = str_replace("\n", "<br>\n", $sValue);
$sCell = str_replace("\n", "<br>\n", $sValue ?? '');
$sRes .= "<TD class=\"label\">$sProperty</TD><TD>$sCell</TD>";
$sRes .= "</TR>";
}