Implement $wgAllowUserRobotsControl to control whether the new __INDEX__ and __NOINDE...
authorAryeh Gregor <simetrical@users.mediawiki.org>
Thu, 24 Jul 2008 17:40:16 +0000 (17:40 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Thu, 24 Jul 2008 17:40:16 +0000 (17:40 +0000)
RELEASE-NOTES
includes/DefaultSettings.php
includes/OutputPage.php

index 5f831d3..841c37e 100644 (file)
@@ -20,12 +20,13 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 
 === Configuration changes in 1.14 ===
 
-None yet
+* (bug 8068) $wgAllowUserRobotsControl (false by default) can enable new
+  __INDEX__ and __NOINDEX__ magic words, which allow user control of search en-
+  gine indexing on a per-article basis.
 
 === New features in 1.14 ===
 
-* (bug 8068) New __INDEX__ and __NOINDEX__ magic words allow control of search
-engine indexing on a per-article basis.
+None yet
 
 === Bug fixes in 1.14 ===
 
index ba04ba5..3cbc409 100644 (file)
@@ -2823,6 +2823,13 @@ $wgNamespaceRobotPolicies = array();
  */
 $wgArticleRobotPolicies = array();
 
+/**
+ * Set to true to allow the __INDEX__ and __NOINDEX__ magic words to function.
+ * These will allow users to control whether any page they can edit is indexed
+ * by search engines.
+ */
+$wgAllowUserRobotsControl = false;
+
 /**
  * Specifies the minimal length of a user password. If set to
  * 0, empty passwords are allowed.
index baacbfd..7fc00ad 100644 (file)
@@ -472,11 +472,15 @@ class OutputPage {
         * @param ParserOutput object &$parserOutput
         */
        public function addParserOutputNoText( &$parserOutput ) {
+               global $wgAllowUserRobotsControl;
+
                $this->mLanguageLinks += $parserOutput->getLanguageLinks();
                $this->addCategoryLinks( $parserOutput->getCategories() );
                $this->mNewSectionLink = $parserOutput->getNewSection();
-               # FIXME: This probably overrides $wgArticleRobotPolicies, is that wise?
-               $this->setIndexPolicy( $parserOutput->getIndexPolicy() );
+               if( $wgAllowUserRobotsControl ) {
+                       # FIXME: This probably overrides $wgArticleRobotPolicies, is that wise?
+                       $this->setIndexPolicy( $parserOutput->getIndexPolicy() );
+               }
                $this->addKeywords( $parserOutput );
                $this->mParseWarnings = $parserOutput->getWarnings();
                if ( $parserOutput->getCacheTime() == -1 ) {