X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryStashImageInfo.php;h=b039a1ec45d93d18932ada3765ecdd635527d3a2;hb=92d93c5d6dc6845600bd78ad668cfd9bbb1ac009;hp=51f486295cdad7c7e1fb9fcdab02fe3a1ba991fd;hpb=6e9b4f0e9ce4ccd6089c18b205065ef7fa077484;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryStashImageInfo.php b/includes/api/ApiQueryStashImageInfo.php index 51f486295c..b039a1ec45 100644 --- a/includes/api/ApiQueryStashImageInfo.php +++ b/includes/api/ApiQueryStashImageInfo.php @@ -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(); @@ -42,7 +46,7 @@ class ApiQueryStashImageInfo extends ApiQueryImageInfo { $result = $this->getResult(); if ( !$params['filekey'] && !$params['sessionkey'] ) { - $this->dieUsage( "One of filekey or sessionkey must be supplied", 'nofilekey' ); + $this->dieUsage( 'One of filekey or sessionkey must be supplied', 'nofilekey' ); } // Alias sessionkey to filekey, but give an existing filekey precedence. @@ -62,9 +66,9 @@ class ApiQueryStashImageInfo extends ApiQueryImageInfo { } // @todo Update exception handling here to understand current getFile exceptions } catch ( UploadStashFileNotFoundException $e ) { - $this->dieUsage( "File not found: " . $e->getMessage(), "invalidsessiondata" ); + $this->dieUsage( 'File not found: ' . $e->getMessage(), 'invalidsessiondata' ); } catch ( UploadStashBadPathException $e ) { - $this->dieUsage( "Bad path: " . $e->getMessage(), "invalidsessiondata" ); + $this->dieUsage( 'Bad path: ' . $e->getMessage(), 'invalidsessiondata' ); } }