Fix title in html header
This commit is contained in:
parent
a6960187f4
commit
23d9353a3d
@ -806,17 +806,19 @@ 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)
|
||||
function dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $onlytags=0)
|
||||
{
|
||||
// escape quotes and backslashes, newlines, etc.
|
||||
$tmp=dol_html_entity_decode($stringtoescape,ENT_COMPAT,'UTF-8');
|
||||
if (! $keepb) $tmp=strtr($tmp, array("<b>"=>'','</b>'=>''));
|
||||
if (! $keepn) $tmp=strtr($tmp, array("\r"=>'\\r',"\n"=>'\\n'));
|
||||
return dol_htmlentities($tmp,ENT_COMPAT,'UTF-8');
|
||||
if ($onlytags) return htmlspecialchars($tmp,ENT_COMPAT,'UTF-8');
|
||||
else return dol_htmlentities($tmp,ENT_COMPAT,'UTF-8');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -450,15 +450,16 @@ if ($action == 'updatemeta')
|
||||
$tplcontent.= '<?php require "./master.inc.php"; ?>'."\n";
|
||||
$tplcontent.= '<html>'."\n";
|
||||
$tplcontent.= '<header>'."\n";
|
||||
$tplcontent.= '<title>'.dol_escape_htmltag($objectpage->title).'</title>'."\n";
|
||||
$tplcontent.= '<title>'.dol_escape_htmltag($objectpage->title, 0, 0, 1).'</title>'."\n";
|
||||
$tplcontent.= '<meta charset="UTF-8">'."\n";
|
||||
$tplcontent.= '<meta http-equiv="content-type" content="text/html; charset=utf-8" />'."\n";
|
||||
$tplcontent.= '<meta name="robots" content="index, follow" />'."\n";
|
||||
$tplcontent.= '<meta name="viewport" content="width=device-width, initial-scale=0.8">'."\n";
|
||||
$tplcontent.= '<link rel="canonical" href="'.$objectpage->pageurl.'">'."\n";
|
||||
$tplcontent.= '<meta name="keywords" content="'.join(', ', explode(',',$objectpage->keywords)).'" />'."\n";
|
||||
$tplcontent.= '<meta name="title" content="'.dol_escape_htmltag($objectpage->title).'" />'."\n";
|
||||
$tplcontent.= '<meta name="description" content="'.dol_escape_htmltag($objectpage->description).'" />'."\n";
|
||||
$tplcontent.= '<meta name="generator" content="'.DOL_APPLICATION_TITLE.'" />'."\n";
|
||||
$tplcontent.= '<meta name="title" content="'.dol_escape_htmltag($objectpage->title, 0, 0, 1).'" />'."\n";
|
||||
$tplcontent.= '<meta name="description" content="'.dol_escape_htmltag($objectpage->description, 0, 0, 1).'" />'."\n";
|
||||
$tplcontent.= '<meta name="generator" content="'.DOL_APPLICATION_TITLE.' '.DOL_VERSION.'" />'."\n";
|
||||
$tplcontent.= '<!-- Include link to CSS file -->'."\n";
|
||||
$tplcontent.= '<link rel="stylesheet" href="styles.css.php?websiteid='.$object->id.'" type="text/css" />'."\n";
|
||||
$tplcontent.= '<!-- Include common HTML header file -->'."\n";
|
||||
@ -607,14 +608,15 @@ if ($action == 'updatecontent' || ($action == 'preview' && (GETPOST('refreshsite
|
||||
$tplcontent.= "// END PHP ?>\n";
|
||||
$tplcontent.= '<html>'."\n";
|
||||
$tplcontent.= '<header>'."\n";
|
||||
$tplcontent.= '<title>'.dol_escape_htmltag($objectpage->title).'</title>'."\n";
|
||||
$tplcontent.= '<title>'.dol_escape_htmltag($objectpage->title, 0, 0, 1).'</title>'."\n";
|
||||
$tplcontent.= '<meta charset="UTF-8">'."\n";
|
||||
$tplcontent.= '<meta http-equiv="content-type" content="text/html; charset=utf-8" />'."\n";
|
||||
$tplcontent.= '<meta name="robots" content="index, follow" />'."\n";
|
||||
$tplcontent.= '<meta name="viewport" content="width=device-width, initial-scale=0.8">'."\n";
|
||||
$tplcontent.= '<meta name="keywords" content="'.join(', ', explode(',',$objectpage->keywords)).'" />'."\n";
|
||||
$tplcontent.= '<meta name="title" content="'.dol_escape_htmltag($objectpage->title).'" />'."\n";
|
||||
$tplcontent.= '<meta name="description" content="'.dol_escape_htmltag($objectpage->description).'" />'."\n";
|
||||
$tplcontent.= '<meta name="generator" content="'.DOL_APPLICATION_TITLE.'" />'."\n";
|
||||
$tplcontent.= '<meta name="title" content="'.dol_escape_htmltag($objectpage->title, 0, 0, 1).'" />'."\n";
|
||||
$tplcontent.= '<meta name="description" content="'.dol_escape_htmltag($objectpage->description, 0, 0, 1).'" />'."\n";
|
||||
$tplcontent.= '<meta name="generator" content="'.DOL_APPLICATION_TITLE.' '.DOL_VERSION.'" />'."\n";
|
||||
$tplcontent.= '<!-- Include link to CSS file -->'."\n";
|
||||
$tplcontent.= '<link rel="stylesheet" href="styles.css.php?websiteid='.$object->id.'" type="text/css" />'."\n";
|
||||
$tplcontent.= '<!-- Include common HTML header file -->'."\n";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user