Remove Revision::getRevisionText from ApiQueryDeletedrevs
[lhc/web/wiklou.git] / includes / api / ApiBlock.php
index 4801267..30a9242 100644 (file)
@@ -98,7 +98,8 @@ class ApiBlock extends ApiBase {
                        }
                }
 
-               if ( $params['hidename'] && !$user->isAllowed( 'hideuser' ) ) {
+               if ( $params['hidename'] &&
+                        !$this->getPermissionManager()->userHasRight( $user, 'hideuser' ) ) {
                        $this->dieWithError( 'apierror-canthide' );
                }
                if ( $params['noemail'] && !SpecialBlock::canBlockEmail( $user ) ) {
@@ -139,8 +140,10 @@ class ApiBlock extends ApiBase {
                        $this->dieStatus( $this->errorArrayToStatus( $retval ) );
                }
 
-               list( $target, /*...*/ ) = SpecialBlock::getTargetAndType( $params['user'] );
+               $res = [];
+
                $res['user'] = $params['user'];
+               list( $target, /*...*/ ) = SpecialBlock::getTargetAndType( $params['user'] );
                $res['userID'] = $target instanceof User ? $target->getId() : 0;
 
                $block = DatabaseBlock::newFromTarget( $target, null, true );