diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 4aead28ffda..a8e08ef1440 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -4107,21 +4107,21 @@ function dol_print_error($db = '', $error = '', $errors = null)
$out .= "".$langs->trans("Date").": ".dol_print_date(time(), 'dayhourlog')."
\n";
$out .= "".$langs->trans("Dolibarr").": ".DOL_VERSION." - https://www.dolibarr.org
\n";
- if (isset($conf->global->MAIN_FEATURES_LEVEL)) $out .= "".$langs->trans("LevelOfFeature").": ".$conf->global->MAIN_FEATURES_LEVEL."
\n";
+ if (isset($conf->global->MAIN_FEATURES_LEVEL)) $out .= "".$langs->trans("LevelOfFeature").": ".dol_htmlentities($conf->global->MAIN_FEATURES_LEVEL, ENT_COMPAT)."
\n";
if (function_exists("phpversion"))
{
$out .= "".$langs->trans("PHP").": ".phpversion()."
\n";
}
- $out .= "".$langs->trans("Server").": ".dol_htmlentities($_SERVER["SERVER_SOFTWARE"])."
\n";
+ $out .= "".$langs->trans("Server").": ".(isset($_SERVER["SERVER_SOFTWARE"]) ? dol_htmlentities($_SERVER["SERVER_SOFTWARE"], ENT_COMPAT) : '')."
\n";
if (function_exists("php_uname"))
{
$out .= "".$langs->trans("OS").": ".php_uname()."
\n";
}
- $out .= "".$langs->trans("UserAgent").": ".dol_htmlentities($_SERVER["HTTP_USER_AGENT"], ENT_COMPAT, 'UTF-8')."
\n";
+ $out .= "".$langs->trans("UserAgent").": ".(isset($_SERVER["HTTP_USER_AGENT"]) ? dol_htmlentities($_SERVER["HTTP_USER_AGENT"], ENT_COMPAT) : '')."
\n";
$out .= "
\n";
- $out .= "".$langs->trans("RequestedUrl").": ".dol_htmlentities($_SERVER["REQUEST_URI"], ENT_COMPAT, 'UTF-8')."
\n";
- $out .= "".$langs->trans("Referer").": ".(isset($_SERVER["HTTP_REFERER"]) ? dol_htmlentities($_SERVER["HTTP_REFERER"], ENT_COMPAT, 'UTF-8') : '')."
\n";
- $out .= "".$langs->trans("MenuManager").": ".(isset($conf->standard_menu) ? dol_htmlentities($conf->standard_menu) : '')."
\n";
+ $out .= "".$langs->trans("RequestedUrl").": ".dol_htmlentities($_SERVER["REQUEST_URI"], ENT_COMPAT)."
\n";
+ $out .= "".$langs->trans("Referer").": ".(isset($_SERVER["HTTP_REFERER"]) ? dol_htmlentities($_SERVER["HTTP_REFERER"], ENT_COMPAT) : '')."
\n";
+ $out .= "".$langs->trans("MenuManager").": ".(isset($conf->standard_menu) ? dol_htmlentities($conf->standard_menu, ENT_COMPAT) : '')."
\n";
$out .= "
\n";
$syslog .= "url=".dol_escape_htmltag($_SERVER["REQUEST_URI"]);
$syslog .= ", query_string=".dol_escape_htmltag($_SERVER["QUERY_STRING"]);