X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fmedia%2FExif.php;h=0fde38636b7ee10b759c40624fd5fdc4989f3ede;hb=3f134f0834d530107ab9b7a76edac934521bb8ad;hp=e4de0a1b5fcc7880823003a4a613fd2616ff4f96;hpb=369b34f0ae64076b91df63e7432f5bf6f19a76a6;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/media/Exif.php b/includes/media/Exif.php index e4de0a1b5f..0fde38636b 100644 --- a/includes/media/Exif.php +++ b/includes/media/Exif.php @@ -290,7 +290,7 @@ class Exif { $this->byteOrder = 'BE'; // BE seems about twice as popular as LE in jpg's. } - $this->debugFile( $this->basename, __FUNCTION__, true ); + $this->debugFile( __FUNCTION__, true ); if ( function_exists( 'exif_read_data' ) ) { Wikimedia\suppressWarnings(); $data = exif_read_data( $this->file, 0, true ); @@ -455,8 +455,7 @@ class Exif { $val = substr( $this->mFilteredExifData[$prop], 8 ); switch ( $charCode ) { - case "\x4A\x49\x53\x00\x00\x00\x00\x00": - // JIS + case "JIS\x00\x00\x00\x00\x00": $charset = "Shift-JIS"; break; case "UNICODE\x00": @@ -742,12 +741,16 @@ class Exif { $ecount = 1; // checking individual elements } } - $count = count( $val ); - if ( $ecount != $count ) { - $this->debug( $val, __FUNCTION__, "Expected $ecount elements for $tag but got $count" ); - return false; + $count = 1; + if ( is_array( $val ) ) { + $count = count( $val ); + if ( $ecount != $count ) { + $this->debug( $val, __FUNCTION__, "Expected $ecount elements for $tag but got $count" ); + return false; + } } + // If there are multiple values, recursively validate each of them. if ( $count > 1 ) { foreach ( $val as $v ) { if ( !$this->validate( $section, $tag, $v, true ) ) {