X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fmedia%2FFormatMetadata.php;h=b008a226884b3e2c4f58bc2e6c7efa43229883a2;hb=6ef64d6a1dc6091f38f9eedd1e60b02a690707cd;hp=6cac1261c7cc9f962eb65e7eb74b030549cc6242;hpb=5256bb8ce2da1390f84ef535d990129eebd74fd2;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/media/FormatMetadata.php b/includes/media/FormatMetadata.php index 6cac1261c7..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 ); } @@ -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; }