From 6739f7f88f63762196966f9bd448f0929a547f61 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 8 Dec 2005 02:38:46 +0000 Subject: [PATCH] * (bug 4212) Skip redundant meta-robots tag for default settings --- RELEASE-NOTES | 1 + includes/OutputPage.php | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 79c174adb9..55cd1b4ca1 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -305,6 +305,7 @@ fully support the editing toolbar, but was found to be too confusing. * (bug 4207) Wrong image size when using 100x200px syntax to scale image up patch by David Benbennick * (bug 4214) Skip redundant action text inserts into the HTML +* (bug 4212) Skip redundant meta-robots tag for default settings === Caveats === diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 56f0aa32ac..d75ba27b0a 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -900,9 +900,13 @@ class OutputPage { } $ret .= "<meta $a=\"{$tag[0]}\" content=\"{$tag[1]}\" />\n"; } + $p = $this->mRobotpolicy; - if ( '' == $p ) { $p = 'index,follow'; } - $ret .= "<meta name=\"robots\" content=\"$p\" />\n"; + if( $p !== '' && $p != 'index,follow' ) { + // http://www.robotstxt.org/wc/meta-user.html + // Only show if it's different from the default robots policy + $ret .= "<meta name=\"robots\" content=\"$p\" />\n"; + } if ( count( $this->mKeywords ) > 0 ) { $strip = array( -- 2.20.1