From ced072f7820da374a8d585699382108b7d8b89d3 Mon Sep 17 00:00:00 2001 From: Glaisher Date: Sun, 11 Sep 2016 18:03:52 +0500 Subject: [PATCH] Special:UserRights: Trim value of $mTarget if it's a string Bug: T145329 Change-Id: I28dd6241525e5ee7d9b09151933321a2f0004252 --- includes/specials/SpecialUserrights.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/includes/specials/SpecialUserrights.php b/includes/specials/SpecialUserrights.php index c7c12396a5..8a06abf594 100644 --- a/includes/specials/SpecialUserrights.php +++ b/includes/specials/SpecialUserrights.php @@ -27,9 +27,12 @@ * @ingroup SpecialPage */ class UserrightsPage extends SpecialPage { - # The target of the local right-adjuster's interest. Can be gotten from - # either a GET parameter or a subpage-style parameter, so have a member - # variable for it. + /** + * The target of the local right-adjuster's interest. Can be gotten from + * either a GET parameter or a subpage-style parameter, so have a member + * variable for it. + * @var null|string $mTarget + */ protected $mTarget; /* * @var null|User $mFetchedUser The user object of the target username or null. @@ -101,6 +104,10 @@ class UserrightsPage extends SpecialPage { $this->mTarget = $request->getVal( 'user' ); } + if ( is_string( $this->mTarget ) ) { + $this->mTarget = trim( $this->mTarget ); + } + $available = $this->changeableGroups(); if ( $this->mTarget === null ) { -- 2.20.1