Followup e48ecbc5: fix fatal error due to undefined variable
[lhc/web/wiklou.git] / includes / api / ApiQueryImageInfo.php
index 5c410a4..4b49a80 100644 (file)
@@ -33,7 +33,7 @@ class ApiQueryImageInfo extends ApiQueryBase {
        const TRANSFORM_LIMIT = 50;
        private static $transformCount = 0;
 
-       public function __construct( $query, $moduleName, $prefix = 'ii' ) {
+       public function __construct( ApiQuery $query, $moduleName, $prefix = 'ii' ) {
                // We allow a subclass to override the prefix, to create a related API
                // module. Some other parts of MediaWiki construct this with a null
                // $prefix, which used to be ignored when this only took two arguments
@@ -256,15 +256,13 @@ class ApiQueryImageInfo extends ApiQueryBase {
         * @return array Array of parameters for transform.
         */
        protected function mergeThumbParams( $image, $thumbParams, $otherParams ) {
-               global $wgThumbLimits;
-
                if ( !isset( $thumbParams['width'] ) && isset( $thumbParams['height'] ) ) {
                        // We want to limit only by height in this situation, so pass the
                        // image's full width as the limiting width. But some file types
                        // don't have a width of their own, so pick something arbitrary so
                        // thumbnailing the default icon works.
                        if ( $image->getWidth() <= 0 ) {
-                               $thumbParams['width'] = max( $wgThumbLimits );
+                               $thumbParams['width'] = max( $this->getConfig()->get( 'ThumbLimits' ) );
                        } else {
                                $thumbParams['width'] = $image->getWidth();
                        }