r86463 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86462‎ | r86463 | r86464 >
Date:11:14, 20 April 2011
Author:catrope
Status:ok (Comments)
Tags:
Comment:
1.17wmf1: (bug 26815) Exception thrown on image description page due to misformatted date in EXIF metadata. Skip misformatted GPS dates without processing. Already fixed in trunk, where this code has been moved around and rewritten
Modified paths:
  • /branches/wmf/1.17wmf1/includes/Exif.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/includes/Exif.php
@@ -1017,7 +1017,10 @@
10181018 break;
10191019
10201020 case 'GPSDateStamp':
1021 - $tags[$tag] = $wgLang->date( substr( $val, 0, 4 ) . substr( $val, 5, 2 ) . substr( $val, 8, 2 ) . '000000' );
 1021+ // Don't try to process misformatted dates, leads to fatals (bug 26815)
 1022+ if ( preg_match( '/^(?:\d{4}):(?:\d\d):(?:\d\d)$/D', $val ) ) {
 1023+ $tags[$tag] = $wgLang->date( substr( $val, 0, 4 ) . substr( $val, 5, 2 ) . substr( $val, 8, 2 ) . '000000' );
 1024+ }
10221025 break;
10231026
10241027 // This is not in the Exif standard, just a special

Comments

#Comment by Duplicatebug (talk | contribs)   20:14, 20 April 2011

wrong bug number: bug 28615

Status & tagging log