* Added rvprop=size to prop=revisions (The size will not be shown if it is NULL in the database)
* list=allpages now allows to filter by article min/max size and protection status
* 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
== Maintenance script changes since 1.10 ==
}
/**
- * Convert 'user' parameter into a proper user login name.
- * This method also validates that this user actually exists in the database.
+ * Validate the 'user' parameter and set the value to compare
+ * against `revision`.`rev_user_text`
*/
private function getUserTitle() {
-
$user = $this->params['user'];
- if (is_null($user))
- $this->dieUsage("User parameter may not be empty", 'param_user');
-
- $userTitle = Title::makeTitleSafe( NS_USER, $user );
- if ( is_null( $userTitle ) )
- $this->dieUsage("User name $user is not valid", 'param_user');
-
- $userid = $this->getDB()->selectField('user', 'user_id', array (
- 'user_name' => $userTitle->getText()
- ));
-
- if (!$userid)
- $this->dieUsage("User name $user not found", 'param_user');
-
- $this->userTitle = $userTitle;
+ if( $user ) {
+ $name = User::isIP( $user )
+ ? $user
+ : User::getCanonicalName( $user, 'valid' );
+ if( $name === false ) {
+ $this->dieUsage( "User name {$user} is not valid", 'param_user' );
+ } else {
+ $this->userTitle = $name;
+ }
+ } else {
+ $this->dieUsage( 'User parameter may not be empty', 'param_user' );
+ }
}
/**
$this->addWhereFld('rev_deleted', 0);
// We only want pages by the specified user.
- $this->addWhereFld('rev_user_text', $this->userTitle->getText());
+ $this->addWhereFld( 'rev_user_text', $this->userTitle );
// ... and in the specified timeframe.
$this->addWhereRange('rev_timestamp',