(bug 2416) Don't allow search engine robots to index or follow nonexisting articles
authorJens Frank <jeluf@users.mediawiki.org>
Thu, 7 Jul 2005 05:02:09 +0000 (05:02 +0000)
committerJens Frank <jeluf@users.mediawiki.org>
Thu, 7 Jul 2005 05:02:09 +0000 (05:02 +0000)
RELEASE-NOTES
includes/Article.php

index 26749ca..1b6ec2c 100644 (file)
@@ -512,6 +512,7 @@ of MediaWiki:Newpagetext) to &action=edit, if page is new.
 * Massive update for Arab (ar) language using Wikipédia
 * (bug 1560) Massive update for Kurdish (ku) language using Wikipédia
 * (bug 2709) Some messages were not read from database
+* (bug 2416) Don't allow search engine robots to index or follow nonexisting articles
 
 
 === Caveats ===
index 5d239e1..6e5e453 100644 (file)
@@ -81,7 +81,7 @@ class Article {
         * @return Return the text of this revision
        */
        function getContent( $noredir ) {
-               global $wgRequest, $wgUser;
+               global $wgRequest, $wgUser, $wgOut;
 
                # Get variables from query string :P
                $action = $wgRequest->getText( 'action', 'view' );
@@ -112,7 +112,7 @@ class Article {
                                return '';
                        }
                        wfProfileOut( $fname );
-
+                       $wgOut->setRobotpolicy( 'noindex,nofollow' );
                        return wfMsg( 'noarticletext' );
                } else {
                        $this->loadContent( $noredir );