r22615 - Code Review

From MediaWiki.org

Jump to: navigation, search
Repository:MediaWiki
Revision:r22614 | r22615 (on ViewVC) | r22616 >
Date:23:09, 31 May 2007
Author:tstarling
Status:new
Tags:
Comment:Added $wgArticleRobotPolicies
Modified paths:

Diff [purge]

Index: trunk/phase3/includes/Article.php
===================================================================
--- trunk/phase3/includes/Article.php	(revision 22614)
+++ trunk/phase3/includes/Article.php	(revision 22615)
@@ -608,7 +608,7 @@
 	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 @@
 		# 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: trunk/phase3/includes/DefaultSettings.php
===================================================================
--- trunk/phase3/includes/DefaultSettings.php	(revision 22614)
+++ trunk/phase3/includes/DefaultSettings.php	(revision 22615)
@@ -2268,6 +2268,16 @@
 $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.
  */
Index: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES	(revision 22614)
+++ trunk/phase3/RELEASE-NOTES	(revision 22615)
@@ -48,6 +48,7 @@
 * 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 ==

Follow-up revisions

RevisionCommit summaryAuthorDate
r22619Merged revisions 22587-22618 via svnmerge fromdavid04:13, 1 June 2007
Views
Toolbox