BUGFIX Fixed SiteTree->MetaTags() to either use <meta name=> or <meta http-equiv=>, and only using the "http-equiv" attribute for valid HTTP headers (see http://www.w3.org/TR/html4/struct/global.html#edef-META)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@100631 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-03-08 20:26:34 +00:00
parent 0b1fc5b91b
commit ca27086c84

View File

@ -1145,17 +1145,15 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
} }
$version = new SapphireInfo(); $version = new SapphireInfo();
$tags .= "<meta name=\"generator\" http-equiv=\"generator\" content=\"SilverStripe - http://www.silverstripe.com\" />\n"; $tags .= "<meta name=\"generator\" content=\"SilverStripe - http://www.silverstripe.com\" />\n";
$charset = ContentNegotiator::get_encoding(); $charset = ContentNegotiator::get_encoding();
$tags .= "<meta http-equiv=\"Content-type\" content=\"text/html; charset=$charset\" />\n"; $tags .= "<meta http-equiv=\"Content-type\" content=\"text/html; charset=$charset\" />\n";
if($this->MetaKeywords) { if($this->MetaKeywords) {
$tags .= "<meta name=\"keywords\" http-equiv=\"keywords\" content=\"" . $tags .= "<meta name=\"keywords\" content=\"" . Convert::raw2att($this->MetaKeywords) . "\" />\n";
Convert::raw2att($this->MetaKeywords) . "\" />\n";
} }
if($this->MetaDescription) { if($this->MetaDescription) {
$tags .= "<meta name=\"description\" http-equiv=\"description\" content=\"" . $tags .= "<meta name=\"description\" content=\"" . Convert::raw2att($this->MetaDescription) . "\" />\n";
Convert::raw2att($this->MetaDescription) . "\" />\n";
} }
if($this->ExtraMeta) { if($this->ExtraMeta) {
$tags .= $this->ExtraMeta . "\n"; $tags .= $this->ExtraMeta . "\n";