Index: branches/wmf/1.17wmf1/includes/Exif.php |
— | — | @@ -1017,7 +1017,10 @@ |
1018 | 1018 | break; |
1019 | 1019 | |
1020 | 1020 | 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 | + } |
1022 | 1025 | break; |
1023 | 1026 | |
1024 | 1027 | // This is not in the Exif standard, just a special |