Merge "filebackend: avoiding computing file SHA-1 hashes unless needed"
[lhc/web/wiklou.git] / includes / api / ApiQueryImageInfo.php
index 18d2804..37a7ff3 100644 (file)
@@ -59,7 +59,8 @@ class ApiQueryImageInfo extends ApiQueryBase {
                if ( isset( $params['badfilecontexttitle'] ) ) {
                        $badFileContextTitle = Title::newFromText( $params['badfilecontexttitle'] );
                        if ( !$badFileContextTitle ) {
-                               $this->dieUsage( 'Invalid title in badfilecontexttitle parameter', 'invalid-title' );
+                               $p = $this->getModulePrefix();
+                               $this->dieWithError( [ 'apierror-bad-badfilecontexttitle', $p ], 'invalid-title' );
                        }
                } else {
                        $badFileContextTitle = false;
@@ -301,7 +302,7 @@ class ApiQueryImageInfo extends ApiQueryBase {
 
                $paramList = $h->parseParamString( $otherParams );
                if ( !$paramList ) {
-                       // Just set a warning (instead of dieUsage), as in many cases
+                       // Just set a warning (instead of dieWithError), as in many cases
                        // we could still render the image using width and height parameters,
                        // and this type of thing could happen between different versions of
                        // handlers.