r24870 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24869‎ | r24870 | r24871 >
Date:13:01, 17 August 2007
Author:robchurch
Status:old
Tags:
Comment:
* (bug 10971) `aufrom` parameter doesn't work with spaces
* Fix username handling issue with `auprefix` parameter

Usernames are *not* stored in "key" format, and treating them as such will cause various comparisons to misbehave. This was preventing `aufrom` from including the username (as it was supposed to) and would have broken `auprefix` for all comparisons containing spaces.

As a side-effect, both these parameters will now treat underscores as equivalent to spaces.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryAllUsers.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryAllUsers.php
@@ -55,12 +55,12 @@
5656 $limit = $params['limit'];
5757 $tables = $db->tableName('user');
5858
59 - if (!is_null($params['from']))
60 - $this->addWhere('user_name>=' . $db->addQuotes(ApiQueryBase :: titleToKey($params['from'])));
 59+ if( !is_null( $params['from'] ) )
 60+ $this->addWhere( 'user_name >= ' . $db->addQuotes( self::keyToTitle( $params['from'] ) ) );
 61+
 62+ if( isset( $params['prefix'] ) )
 63+ $this->addWhere( 'user_name LIKE "' . $db->escapeLike( self::keyToTitle( $params['prefix'] ) ) . '%"' );
6164
62 - if (isset($params['prefix']))
63 - $this->addWhere("user_name LIKE '" . $db->escapeLike(ApiQueryBase :: titleToKey($params['prefix'])) . "%'");
64 -
6565 if (!is_null($params['group'])) {
6666 // Filter only users that belong to a given group
6767 $tblName = $db->tableName('user_groups');
Index: trunk/phase3/RELEASE-NOTES
@@ -441,6 +441,9 @@
442442 * Added site statistics (siprop=statistics for meta=siteinfo)
443443 * (bug 10902) Unable to fetch user contributions from IP addresses
444444 * `list=usercontribs` no longer requires that the user exist
 445+* (bug 10971) `aufrom` parameter doesn't work with spaces
 446+* Fix username handling issue with `auprefix` parameter
 447+* Treat underscores as spaces for `aufrom` and `auprefix` parameters
445448
446449 == Maintenance script changes since 1.10 ==
447450

Follow-up revisions

RevisionCommit summaryAuthorDate
r25016Merged revisions 24866-25015 via svnmerge from...david23:06, 21 August 2007

Status & tagging log