function convertMetadataVersion( $metadata, $version = 1 ) {
// basically flattens arrays.
- $version = explode( ';', $version, 2 );
- $version = intval( $version[0] );
+ $version = intval( explode( ';', $version, 2 )[0] );
if ( $version < 1 || $version >= 2 ) {
return $metadata;
}
if ( isset( $exif['MEDIAWIKI_EXIF_VERSION'] )
&& $exif['MEDIAWIKI_EXIF_VERSION'] == 1
) {
- //back-compatible but old
+ // back-compatible but old
wfDebug( __METHOD__ . ": back-compat version\n" );
return self::METADATA_COMPATIBLE;
) {
// So we don't try and display metadata from PagedTiffHandler
// for example when using InstantCommons.
- return array();
+ return [];
}
$exif = unserialize( $metadata );
if ( !$exif ) {
- return array();
+ return [];
}
unset( $exif['MEDIAWIKI_EXIF_VERSION'] );
* Wrapper for base classes ImageHandler::getImageSize() that checks for
* rotation reported from metadata and swaps the sizes to match.
*
- * @param File $image
+ * @param File|FSFile $image
* @param string $path
* @return array
*/