(bug 8407) Disallow indexing of "printable" versions
authorRob Church <robchurch@users.mediawiki.org>
Sun, 14 Jan 2007 21:28:23 +0000 (21:28 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Sun, 14 Jan 2007 21:28:23 +0000 (21:28 +0000)
RELEASE-NOTES
includes/Article.php

index 1c839c7..b74d0cf 100644 (file)
@@ -68,6 +68,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 8632) Fix regression in page protection null edit update
 * (bug 7842) Link back to deleted revision list from deleted revision preview
 * (bug 8619) Add user-aware "unblock" link to Special:Blockip
+* (bug 8407) Disallow indexing of "printable" versions
 
 == Languages updated ==
 
index ab6ad0a..bee90bf 100644 (file)
@@ -630,14 +630,18 @@ class Article {
                $diffOnly = $wgRequest->getBool( 'diffonly', $wgUser->getOption( 'diffonly' ) );
 
                $wgOut->setArticleFlag( true );
-               if ( isset( $wgNamespaceRobotPolicies[$ns] ) ) {
+               
+               # Discourage indexing of printable versions, but encourage following
+               if( $wgOut->isPrintable() ) {
+                       $policy = 'noindex,follow';
+               } elseif( isset( $wgNamespaceRobotPolicies[$ns] ) ) {
+                       # Honour customised robot policies for this namespace
                        $policy = $wgNamespaceRobotPolicies[$ns];
                } else {
-                       # The default policy. Dev note: make sure you change the documentation
-                       # in DefaultSettings.php before changing it.
+                       # Default to encourage indexing and following links
                        $policy = 'index,follow';
                }
-               $wgOut->setRobotpolicy( $policy );
+               $wgOut->setRobotPolicy( $policy );
 
                # If we got diff and oldid in the query, we want to see a
                # diff page instead of the article.