From: Glaisher Date: Sun, 11 Sep 2016 13:03:52 +0000 (+0500) Subject: Special:UserRights: Trim value of $mTarget if it's a string X-Git-Tag: 1.31.0-rc.0~5652^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=ced072f7820da374a8d585699382108b7d8b89d3;p=lhc%2Fweb%2Fwiklou.git Special:UserRights: Trim value of $mTarget if it's a string Bug: T145329 Change-Id: I28dd6241525e5ee7d9b09151933321a2f0004252 --- 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 ) {