Check whether a user is blocked from upload in ApiUpload
authorThalia <thalia.e.chan@googlemail.com>
Wed, 20 Mar 2019 22:11:33 +0000 (22:11 +0000)
committerThalia <thalia.e.chan@googlemail.com>
Wed, 20 Mar 2019 22:19:02 +0000 (22:19 +0000)
Partially blocked users are not blocked from uploading, so check
explicitly whether a user is blocked from uploading, rather than
simply whether they have a block.

Bug: T217255
Change-Id: I21089a90202941ec3bc5bdbf9c0d2e7cab00b365

includes/api/ApiUpload.php

index 2c5b583..12ecd74 100644 (file)
@@ -542,7 +542,7 @@ class ApiUpload extends ApiBase {
                }
 
                // Check blocks
-               if ( $user->isBlocked() ) {
+               if ( $user->isBlockedFromUpload() ) {
                        $this->dieBlocked( $user->getBlock() );
                }