* (bug 10971) `aufrom` parameter doesn't work with spaces
authorRob Church <robchurch@users.mediawiki.org>
Fri, 17 Aug 2007 13:01:35 +0000 (13:01 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Fri, 17 Aug 2007 13:01:35 +0000 (13:01 +0000)
* 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.

RELEASE-NOTES
includes/api/ApiQueryAllUsers.php

index 681a8f2..3ffb7f8 100644 (file)
@@ -441,6 +441,9 @@ Full API documentation is available at http://www.mediawiki.org/wiki/API
 * Added site statistics (siprop=statistics for meta=siteinfo)
 * (bug 10902) Unable to fetch user contributions from IP addresses
 * `list=usercontribs` no longer requires that the user exist
+* (bug 10971) `aufrom` parameter doesn't work with spaces
+* Fix username handling issue with `auprefix` parameter
+* Treat underscores as spaces for `aufrom` and `auprefix` parameters
 
 == Maintenance script changes since 1.10 ==
 
index 837123c..1a60983 100644 (file)
@@ -55,11 +55,11 @@ class ApiQueryAllUsers extends ApiQueryBase {
                $limit = $params['limit'];
                $tables = $db->tableName('user');
                
-               if (!is_null($params['from']))
-                       $this->addWhere('user_name>=' . $db->addQuotes(ApiQueryBase :: titleToKey($params['from'])));
-
-               if (isset($params['prefix']))
-                       $this->addWhere("user_name LIKE '" . $db->escapeLike(ApiQueryBase :: titleToKey($params['prefix'])) . "%'");
+               if( !is_null( $params['from'] ) )
+                       $this->addWhere( 'user_name >= ' . $db->addQuotes( self::keyToTitle( $params['from'] ) ) );
+               
+               if( isset( $params['prefix'] ) )
+                       $this->addWhere( 'user_name LIKE "' . $db->escapeLike( self::keyToTitle( $params['prefix'] ) ) . '%"' );
 
                if (!is_null($params['group'])) {
                        // Filter only users that belong to a given group