Merge "Revert "ApiSandbox: Display params as JSON on request page""
[lhc/web/wiklou.git] / includes / api / ApiQueryBacklinks.php
index fb502e4..613589e 100644 (file)
@@ -344,12 +344,12 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase {
                        $this->validateLimit( 'limit', $this->params['limit'], 1, $userMax, $botMax );
                }
 
-               $this->rootTitle = $this->getTitleOrPageId( $this->params )->getTitle();
+               $this->rootTitle = $this->getTitleFromTitleOrPageId( $this->params );
 
                // only image titles are allowed for the root in imageinfo mode
                if ( !$this->hasNS && $this->rootTitle->getNamespace() !== NS_FILE ) {
-                       $this->dieUsage(
-                               "The title for {$this->getModuleName()} query must be a file",
+                       $this->dieWithError(
+                               [ 'apierror-imageusage-badtitle', $this->getModuleName() ],
                                'bad_image_title'
                        );
                }