Merge "registration: Support $wgMediaHandlers in ExtensionProcessor"
[lhc/web/wiklou.git] / includes / api / ApiQueryStashImageInfo.php
index 1debb2e..3de72bf 100644 (file)
@@ -52,18 +52,16 @@ class ApiQueryStashImageInfo extends ApiQueryImageInfo {
                }
 
                try {
-                       $stash = RepoGroup::singleton()->getLocalRepo()->getUploadStash();
+                       $stash = RepoGroup::singleton()->getLocalRepo()->getUploadStash( $this->getUser() );
 
                        foreach ( $params['filekey'] as $filekey ) {
                                $file = $stash->getFile( $filekey );
                                $finalThumbParam = $this->mergeThumbParams( $file, $scale, $params['urlparam'] );
                                $imageInfo = ApiQueryImageInfo::getInfo( $file, $prop, $result, $finalThumbParam );
                                $result->addValue( array( 'query', $this->getModuleName() ), null, $imageInfo );
-                               $result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), $modulePrefix );
+                               $result->addIndexedTagName( array( 'query', $this->getModuleName() ), $modulePrefix );
                        }
                // @todo Update exception handling here to understand current getFile exceptions
-               } catch ( UploadStashNotAvailableException $e ) {
-                       $this->dieUsage( "Session not available: " . $e->getMessage(), "nosession" );
                } catch ( UploadStashFileNotFoundException $e ) {
                        $this->dieUsage( "File not found: " . $e->getMessage(), "invalidsessiondata" );
                } catch ( UploadStashBadPathException $e ) {
@@ -124,4 +122,8 @@ class ApiQueryStashImageInfo extends ApiQueryImageInfo {
                                => 'apihelp-query+stashimageinfo-example-params',
                );
        }
+
+       public function getHelpUrls() {
+               return 'https://www.mediawiki.org/wiki/API:Stashimageinfo';
+       }
 }