Special:UserRights: Trim value of $mTarget if it's a string
authorGlaisher <glaisher.wiki@gmail.com>
Sun, 11 Sep 2016 13:03:52 +0000 (18:03 +0500)
committerGlaisher <glaisher.wiki@gmail.com>
Sun, 11 Sep 2016 13:06:20 +0000 (18:06 +0500)
Bug: T145329
Change-Id: I28dd6241525e5ee7d9b09151933321a2f0004252

includes/specials/SpecialUserrights.php

index c7c1239..8a06abf 100644 (file)
  * @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 ) {