r45712 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45711‎ | r45712 | r45713 >
Date:18:37, 13 January 2009
Author:aaron
Status:resolved (Comments)
Tags:
Comment:
(bug 11443) Auto-noindex user/user talk pages for blocked users
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -853,7 +853,15 @@
854854 // for better machine handling of broken links.
855855 $return404 = true;
856856 }
857 - }
 857+ } else if( $ns == NS_USER || $ns == NS_USER_TALK ) {
 858+ # User/User_talk subpages are not modified. (bug 11443)
 859+ if( !$this->mTitle->isSubpage() ) {
 860+ $block = new Block();
 861+ if( $block->load( $this->mTitle->getBaseText() ) ) {
 862+ $wgOut->setRobotpolicy( 'noindex,nofollow' );
 863+ }
 864+ }
 865+ }
858866
859867 if( $return404 ) {
860868 $wgRequest->response()->header( "HTTP/1.x 404 Not Found" );

Comments

#Comment by Brion VIBBER (talk | contribs)   23:37, 14 January 2009

This code doesn't fire on parser cache hits... needs to be pulled up before.

#Comment by Aaron Schulz (talk | contribs)   13:40, 16 January 2009

Fixed in r45760

Status & tagging log