r111830 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111829‎ | r111830 | r111831 >
Date:15:11, 18 February 2012
Author:reedy
Status:ok
Tags:
Comment:
Modified paths:
  • /branches/wmf/1.19wmf1/extensions (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/AntiSpoof/SpoofUser.php (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/CentralAuth/AntiSpoof/CentralAuthSpoofUser.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.19wmf1/extensions/AntiSpoof/SpoofUser.php
@@ -43,6 +43,20 @@
4444 }
4545
4646 /**
 47+ * @return string
 48+ */
 49+ protected function getTableName() {
 50+ return 'user';
 51+ }
 52+
 53+ /**
 54+ * @return string
 55+ */
 56+ protected function getUserColumn() {
 57+ return 'user_name';
 58+ }
 59+
 60+ /**
4761 * Does the username pass Unicode legality and script-mixing checks?
4862 *
4963 * @return array empty if no conflict, or array containing conflicting usernames
@@ -53,11 +67,11 @@
5468 // Join against the user table to ensure that we skip stray
5569 // entries left after an account is renamed or otherwise munged.
5670 $spoofedUsers = $dbr->select(
57 - array( 'spoofuser', 'user' ),
58 - array( 'user_name' ),
 71+ array( 'spoofuser', $this->getTableName() ),
 72+ array( 'su_name' ), // Same thing due to the join. Saves extra variableness
5973 array(
6074 'su_normalized' => $this->mNormalized,
61 - 'su_name=user_name',
 75+ 'su_name = ' . $this->getUserColumn(),
6276 ),
6377 __METHOD__,
6478 array(
@@ -66,7 +80,7 @@
6781
6882 $spoofs = array();
6983 foreach ( $spoofedUsers as $row ) {
70 - array_push( $spoofs, $row->user_name );
 84+ array_push( $spoofs, $row->su_name );
7185 }
7286 return $spoofs;
7387 }
Index: branches/wmf/1.19wmf1/extensions/CentralAuth/AntiSpoof/CentralAuthSpoofUser.php
@@ -14,4 +14,18 @@
1515 protected static function getDBMaster() {
1616 return CentralAuthUser::getCentralDB();
1717 }
 18+
 19+ /**
 20+ * @return string
 21+ */
 22+ protected function getTableName() {
 23+ return 'globaluser';
 24+ }
 25+
 26+ /**
 27+ * @return string
 28+ */
 29+ protected function getUserColumn() {
 30+ return 'gu_name';
 31+ }
1832 }
Property changes on: branches/wmf/1.19wmf1/extensions
___________________________________________________________________
Modified: svn:mergeinfo
1933 Merged /trunk/extensions:r111814

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r111814Actually variablise the table/column we're reading user information from - no...reedy02:48, 18 February 2012

Status & tagging log