diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 1bd2b770d1a..fae3c4eae5e 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -806,19 +806,17 @@ function dol_escape_js($stringtoescape, $mode=0, $noescapebackslashn=0)
* @param string $stringtoescape String to escape
* @param int $keepb 1=Preserve b tags (otherwise, remove them)
* @param int $keepn 1=Preserve \r\n strings (otherwise, remove them)
- * @param int $onlytags Only special chars like (", &, >, > ...) are replaced, not all chars that has an existing entity.
* @return string Escaped string
*
* @see dol_string_nohtmltag
*/
-function dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $onlytags=0)
+function dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0)
{
// escape quotes and backslashes, newlines, etc.
$tmp=dol_html_entity_decode($stringtoescape,ENT_COMPAT,'UTF-8');
if (! $keepb) $tmp=strtr($tmp, array(""=>'',''=>''));
if (! $keepn) $tmp=strtr($tmp, array("\r"=>'\\r',"\n"=>'\\n'));
- if ($onlytags) return htmlspecialchars($tmp,ENT_COMPAT,'UTF-8');
- else return dol_htmlentities($tmp,ENT_COMPAT,'UTF-8');
+ return dol_htmlentities($tmp,ENT_COMPAT,'UTF-8');
}
diff --git a/htdocs/websites/index.php b/htdocs/websites/index.php
index de292128ef5..6d1b61975ed 100644
--- a/htdocs/websites/index.php
+++ b/htdocs/websites/index.php
@@ -450,15 +450,15 @@ if ($action == 'updatemeta')
$tplcontent.= ''."\n";
$tplcontent.= ''."\n";
$tplcontent.= ''."\n";
- $tplcontent.= ''.dol_escape_htmltag($objectpage->title, 0, 0, 1).''."\n";
+ $tplcontent.= ''.dol_string_nohtmltag($objectpage->title, 0, 'UTF-8').''."\n";
$tplcontent.= ''."\n";
$tplcontent.= ''."\n";
$tplcontent.= ''."\n";
$tplcontent.= ''."\n";
$tplcontent.= ''."\n";
$tplcontent.= ''."\n";
- $tplcontent.= ''."\n";
- $tplcontent.= ''."\n";
+ $tplcontent.= ''."\n";
+ $tplcontent.= ''."\n";
$tplcontent.= ''."\n";
$tplcontent.= ''."\n";
$tplcontent.= ''."\n";
@@ -608,14 +608,14 @@ if ($action == 'updatecontent' || ($action == 'preview' && (GETPOST('refreshsite
$tplcontent.= "// END PHP ?>\n";
$tplcontent.= ''."\n";
$tplcontent.= ''."\n";
- $tplcontent.= ''.dol_escape_htmltag($objectpage->title, 0, 0, 1).''."\n";
+ $tplcontent.= ''.dol_string_nohtmltag($objectpage->title, 0, 'UTF-8').''."\n";
$tplcontent.= ''."\n";
$tplcontent.= ''."\n";
$tplcontent.= ''."\n";
$tplcontent.= ''."\n";
$tplcontent.= ''."\n";
- $tplcontent.= ''."\n";
- $tplcontent.= ''."\n";
+ $tplcontent.= ''."\n";
+ $tplcontent.= ''."\n";
$tplcontent.= ''."\n";
$tplcontent.= ''."\n";
$tplcontent.= ''."\n";