From: Tim Starling Date: Thu, 31 May 2007 23:09:36 +0000 (+0000) Subject: Added $wgArticleRobotPolicies X-Git-Tag: 1.31.0-rc.0~52738 X-Git-Url: https://git.cyclocoop.org/?a=commitdiff_plain;h=52fe665df7994c24bc0960cf386d5d053752aec5;p=lhc%2Fweb%2Fwiklou.git Added $wgArticleRobotPolicies --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 25e03854af..a8c5365535 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/Article.php b/includes/Article.php index 79bc6e5114..304b8660e9 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -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]; diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 32488d16cd..e29e53ff51 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -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.