Added $wgArticleRobotPolicies
authorTim Starling <tstarling@users.mediawiki.org>
Thu, 31 May 2007 23:09:36 +0000 (23:09 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Thu, 31 May 2007 23:09:36 +0000 (23:09 +0000)
RELEASE-NOTES
includes/Article.php
includes/DefaultSettings.php

index 25e0385..a8c5365 100644 (file)
@@ -48,6 +48,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Added a Content-Disposition header to thumb.php output
 * Improved thumb.php error handling
 * Display file history on local image description pages of shared images
+* Added $wgArticleRobotPolicies
 
 
 == Bugfixes since 1.10 ==
index 79bc6e5..304b866 100644 (file)
@@ -608,7 +608,7 @@ class Article {
        function view() {
                global $wgUser, $wgOut, $wgRequest, $wgContLang;
                global $wgEnableParserCache, $wgStylePath, $wgUseRCPatrol, $wgParser;
-               global $wgUseTrackbacks, $wgNamespaceRobotPolicies;
+               global $wgUseTrackbacks, $wgNamespaceRobotPolicies, $wgArticleRobotPolicies;
                $sk = $wgUser->getSkin();
 
                wfProfileIn( __METHOD__ );
@@ -636,6 +636,8 @@ class Article {
                # Discourage indexing of printable versions, but encourage following
                if( $wgOut->isPrintable() ) {
                        $policy = 'noindex,follow';
+               } elseif ( isset( $wgArticleRobotPolicies[$this->mTitle->getPrefixedText()] ) ) {
+                       $policy = $wgArticleRobotPolicies[$this->mTitle->getPrefixedText()];
                } elseif( isset( $wgNamespaceRobotPolicies[$ns] ) ) {
                        # Honour customised robot policies for this namespace
                        $policy = $wgNamespaceRobotPolicies[$ns];
index 32488d1..e29e53f 100644 (file)
@@ -2267,6 +2267,16 @@ $wgNoFollowNsExceptions = array();
  */
 $wgNamespaceRobotPolicies = array();
 
+/**
+ * Robot policies per article.
+ * These override the per-namespace robot policies.
+ * Must be in the form of an array where the key part is a properly 
+ * canonicalised text form title and the value is a robot policy.
+ * Example:
+ *   $wgArticleRobotPolicies = array( 'Main Page' => 'noindex' );
+ */
+$wgArticleRobotPolicies = array();
+
 /**
  * Specifies the minimal length of a user password. If set to
  * 0, empty passwords are allowed.