diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index d4f1a38fbbb..fb162927f03 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -2778,7 +2778,7 @@ function dol_print_error($db='',$error='',$errors=null)
if (empty($msg)) continue;
if ($_SERVER['DOCUMENT_ROOT']) // Mode web
{
- $out.="".$langs->trans("Message").": ".$msg."
\n" ;
+ $out.="".$langs->trans("Message").": ".dol_escape_htmltag($msg)."
\n" ;
}
else // Mode CLI
{