X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fmedia%2FFormatMetadata.php;h=b008a226884b3e2c4f58bc2e6c7efa43229883a2;hb=6ef64d6a1dc6091f38f9eedd1e60b02a690707cd;hp=69982c2fb4f2d5e0e02e5180d1e7d2c2411327e6;hpb=bb866e75d0c6e7e47f59371fd5b9e37fc6e66fc8;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/media/FormatMetadata.php b/includes/media/FormatMetadata.php index 69982c2fb4..b008a22688 100644 --- a/includes/media/FormatMetadata.php +++ b/includes/media/FormatMetadata.php @@ -740,8 +740,13 @@ class FormatMetadata extends ContextSource { case 'Software': if ( is_array( $val ) ) { - // if its a software, version array. - $val = $this->msg( 'exif-software-version-value', $val[0], $val[1] )->text(); + if ( count( $val ) > 1 ) { + // if its a software, version array. + $val = $this->msg( 'exif-software-version-value', $val[0], $val[1] )->text(); + } else { + // https://phabricator.wikimedia.org/T178130 + $val = $this->exifMsg( $tag, '', $val[0] ); + } } else { $val = $this->exifMsg( $tag, '', $val ); } @@ -1675,7 +1680,7 @@ class FormatMetadata extends ContextSource { * * @param File $file File to use * @param array $extendedMetadata - * @param int $maxCacheTime Hook handlers might use this parameter to override cache time + * @param int &$maxCacheTime Hook handlers might use this parameter to override cache time * * @return array [ => ['value' => ]], or [] on error * @since 1.23 @@ -1761,9 +1766,9 @@ class FormatMetadata extends ContextSource { } return $newValue; } else { // _type is 'ul' or 'ol' or missing in which case it defaults to 'ul' - list( $k, $v ) = each( $value ); - if ( $k === '_type' ) { - $v = current( $value ); + $v = reset( $value ); + if ( key( $value ) === '_type' ) { + $v = next( $value ); } return $v; } @@ -1772,7 +1777,7 @@ class FormatMetadata extends ContextSource { /** * Takes an array returned by the getExtendedMetadata* functions, * and resolves multi-language values in it. - * @param array $metadata + * @param array &$metadata * @since 1.23 */ protected function resolveMultilangMetadata( &$metadata ) { @@ -1789,7 +1794,7 @@ class FormatMetadata extends ContextSource { /** * Takes an array returned by the getExtendedMetadata* functions, * and turns all fields into single-valued ones by dropping extra values. - * @param array $metadata + * @param array &$metadata * @since 1.25 */ protected function discardMultipleValues( &$metadata ) { @@ -1810,7 +1815,7 @@ class FormatMetadata extends ContextSource { /** * Makes sure the given array is a valid API response fragment - * @param array $arr + * @param array &$arr */ protected function sanitizeArrayForAPI( &$arr ) { if ( !is_array( $arr ) ) {