Merge "Add new grammar forms for language names in Russian"
[lhc/web/wiklou.git] / includes / api / ApiQueryImageInfo.php
index 02846dc..736ac45 100644 (file)
@@ -339,7 +339,8 @@ class ApiQueryImageInfo extends ApiQueryBase {
                // in the actual normalised version, only if we can actually normalise them,
                // so we use the functions scope to throw away the normalisations.
                if ( !$h->normaliseParams( $image, $finalParams ) ) {
-                       $this->dieUsage( "Could not normalise image parameters for " . $image->getName(), "urlparamnormal" );
+                       $this->dieUsage( 'Could not normalise image parameters for ' .
+                               $image->getName(), 'urlparamnormal' );
                }
        }
 
@@ -480,7 +481,7 @@ class ApiQueryImageInfo extends ApiQueryBase {
                }
 
                if ( !$canShowField( File::DELETED_FILE ) ) {
-                       //Early return, tidier than indenting all following things one level
+                       // Early return, tidier than indenting all following things one level
                        return $vals;
                }
 
@@ -523,9 +524,9 @@ class ApiQueryImageInfo extends ApiQueryBase {
                }
 
                if ( $meta ) {
-                       wfSuppressWarnings();
+                       MediaWiki\suppressWarnings();
                        $metadata = unserialize( $file->getMetadata() );
-                       wfRestoreWarnings();
+                       MediaWiki\restoreWarnings();
                        if ( $metadata && $version !== 'latest' ) {
                                $metadata = $file->convertMetadataVersion( $metadata, $version );
                        }
@@ -592,7 +593,10 @@ class ApiQueryImageInfo extends ApiQueryBase {
                $retval = array();
                if ( is_array( $metadata ) ) {
                        foreach ( $metadata as $key => $value ) {
-                               $r = array( 'name' => $key );
+                               $r = array(
+                                       'name' => $key,
+                                       ApiResult::META_BC_BOOLS => array( 'value' ),
+                               );
                                if ( is_array( $value ) ) {
                                        $r['value'] = self::processMetaData( $value, $result );
                                } else {