r20438 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r20437‎ | r20438 | r20439 >
Date:05:36, 14 March 2007
Author:aaron
Status:old
Tags:
Comment:
*Users with hidden names can't edit their talk page
Modified paths:
  • /trunk/phase3/includes/User.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -881,7 +881,8 @@
882882 wfProfileIn( __METHOD__ );
883883 wfDebug( __METHOD__.": checking...\n" );
884884
885 - $this->mBlockedby = 0;
 885+ $this->mBlockedby = 0;
 886+ $this->mHideName = 0;
886887 $ip = wfGetIP();
887888
888889 if ($this->isAllowed( 'ipblock-exempt' ) ) {
@@ -896,6 +897,7 @@
897898 wfDebug( __METHOD__.": Found block.\n" );
898899 $this->mBlockedby = $this->mBlock->mBy;
899900 $this->mBlockreason = $this->mBlock->mReason;
 901+ $this->mHideName = $this->mBlock->mHideName;
900902 if ( $this->isLoggedIn() ) {
901903 $this->spreadBlock();
902904 }
@@ -1074,14 +1076,13 @@
10751077 wfProfileIn( __METHOD__ );
10761078 wfDebug( __METHOD__.": enter\n" );
10771079
1078 - if ( $wgBlockAllowsUTEdit && $title->getText() === $this->getName() &&
1079 - $title->getNamespace() == NS_USER_TALK )
1080 - {
 1080+ wfDebug( __METHOD__.": asking isBlocked()\n" );
 1081+ $blocked = $this->isBlocked( $bFromSlave );
 1082+ # If a user's name is suppressed, they cannot make edits anywhere
 1083+ if ( !$this->mHideName && $wgBlockAllowsUTEdit && $title->getText() === $this->getName() &&
 1084+ $title->getNamespace() == NS_USER_TALK ) {
10811085 $blocked = false;
10821086 wfDebug( __METHOD__.": self-talk page, ignoring any blocks\n" );
1083 - } else {
1084 - wfDebug( __METHOD__.": asking isBlocked()\n" );
1085 - $blocked = $this->isBlocked( $bFromSlave );
10861087 }
10871088 wfProfileOut( __METHOD__ );
10881089 return $blocked;