Set canonical tag

This commit is contained in:
Laurent Destailleur 2018-10-15 17:48:39 +02:00
parent 743d4d7c01
commit 96ddebad4a
2 changed files with 2 additions and 0 deletions

View File

@ -624,6 +624,7 @@ function dolSavePageContent($filetpl, $object, $objectpage)
$tplcontent.= '<meta name="title" content="'.dol_string_nohtmltag($objectpage->title, 0, 'UTF-8').'" />'."\n";
$tplcontent.= '<meta name="description" content="'.dol_string_nohtmltag($objectpage->description, 0, 'UTF-8').'" />'."\n";
$tplcontent.= '<meta name="generator" content="'.DOL_APPLICATION_TITLE.' '.DOL_VERSION.' (https://www.dolibarr.org)" />'."\n";
$tplcontent.= '<link href="/'.$objectpage->pageurl.'.php" rel="canonical" />'."\n";
$tplcontent.= '<!-- Include link to CSS file -->'."\n";
$tplcontent.= '<link rel="stylesheet" href="styles.css.php?website=<?php echo $websitekey; ?>" type="text/css" />'."\n";
$tplcontent.= '<!-- Include HTML header from common file -->'."\n";

View File

@ -459,6 +459,7 @@ if ($action == 'addcontainer')
//$objectpage->htmlheader = preg_replace('/<meta name="msvalidate.01[^>]*>\n*/ims', '', $objectpage->htmlheader);
$objectpage->htmlheader = preg_replace('/<title>[^<]*<\/title>\n*/ims', '', $objectpage->htmlheader);
$objectpage->htmlheader = preg_replace('/<link[^>]*rel="shortcut[^>]*>\n/ims', '', $objectpage->htmlheader);
$objectpage->htmlheader = preg_replace('/<link[^>]*rel="canonical[^>]*>\n/ims', '', $objectpage->htmlheader);
// Now loop to fetch JS
$tmp = $objectpage->htmlheader;