ApiQueryStashImageInfo: Don't throw exceptions when the user is not logged in
authorBartosz Dziewoński <matma.rex@gmail.com>
Fri, 18 Mar 2016 00:14:35 +0000 (01:14 +0100)
committerBartosz Dziewoński <matma.rex@gmail.com>
Fri, 18 Mar 2016 15:22:58 +0000 (16:22 +0100)
Bug: T130253
Change-Id: If70b919c65a21b57b3022d495756bf250b0ba786

includes/api/ApiQueryStashImageInfo.php

index 6d1540b..b039a1e 100644 (file)
@@ -32,6 +32,10 @@ class ApiQueryStashImageInfo extends ApiQueryImageInfo {
        }
 
        public function execute() {
+               if ( !$this->getUser()->isLoggedIn() ) {
+                       $this->dieUsage( 'You must be logged-in to have an upload stash', 'notloggedin' );
+               }
+
                $params = $this->extractRequestParams();
                $modulePrefix = $this->getModulePrefix();