From 70e0646bf01b6c3ded1594bd50f2062998b797db Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Sat, 22 Nov 2008 15:46:36 +0000 Subject: [PATCH] API: (bug 16421) Actually do user name normalization in list=logevents. Also fix up User::idFromName so it doesn't think "Talk:Catrope" isn't the same user as "Catrope" --- RELEASE-NOTES | 2 ++ includes/User.php | 2 +- includes/api/ApiQueryLogEvents.php | 4 +--- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 8060eaa736..926e04c86e 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -454,6 +454,8 @@ The following extensions are migrated into MediaWiki 1.14: limits * (bug 16398) meta=userinfo&uiprop=rights lists some rights twice in some cases * (bug 16408) Added rvgeneratexml to prop=revisions +* (bug 16421) Made list=logevents's leuser accept user names with underscores + instead of spaces === Languages updated in 1.14 === diff --git a/includes/User.php b/includes/User.php index 3ebd7060d6..d6793b70fc 100644 --- a/includes/User.php +++ b/includes/User.php @@ -440,7 +440,7 @@ class User { * @static */ static function idFromName( $name ) { - $nt = Title::newFromText( $name ); + $nt = Title::makeTitleSafe( NS_USER, $name ); if( is_null( $nt ) ) { # Illegal name return null; diff --git a/includes/api/ApiQueryLogEvents.php b/includes/api/ApiQueryLogEvents.php index 4dd82e1de5..84bd15d6ec 100644 --- a/includes/api/ApiQueryLogEvents.php +++ b/includes/api/ApiQueryLogEvents.php @@ -97,9 +97,7 @@ class ApiQueryLogEvents extends ApiQueryBase { $index = false; $user = $params['user']; if (!is_null($user)) { - $userid = $db->selectField('user', 'user_id', array ( - 'user_name' => $user - )); + $userid = User::idFromName($user); if (!$userid) $this->dieUsage("User name $user not found", 'param_user'); $this->addWhereFld('log_user', $userid); -- 2.20.1