diff --git a/application/ui.extkeywidget.class.inc.php b/application/ui.extkeywidget.class.inc.php index 4162ebcfe..4f123fab2 100644 --- a/application/ui.extkeywidget.class.inc.php +++ b/application/ui.extkeywidget.class.inc.php @@ -298,7 +298,7 @@ EOF $sHTMLValue .= "iId\" value=\"$sDisplayValue\" placeholder='...'/>"; // another hidden input to store & pass the object's Id - $sHTMLValue .= "iId\" name=\"{$sAttrFieldPrefix}{$sFieldName}\" value=\"".htmlentities($value, ENT_QUOTES, 'UTF-8')."\" />\n"; + $sHTMLValue .= "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 diff --git a/application/utils.inc.php b/application/utils.inc.php index 5a44ed348..53779cb53 100644 --- a/application/utils.inc.php +++ b/application/utils.inc.php @@ -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'); } /** diff --git a/core/ormstopwatch.class.inc.php b/core/ormstopwatch.class.inc.php index b4dddbb91..5771381d6 100644 --- a/core/ormstopwatch.class.inc.php +++ b/core/ormstopwatch.class.inc.php @@ -242,7 +242,7 @@ class ormStopWatch foreach ($aProperties as $sProperty => $sValue) { $sRes .= "