Fix #8417 : Handle EXIF unknown date
authorAntoine Musso <hashar@users.mediawiki.org>
Sat, 6 Jan 2007 15:31:39 +0000 (15:31 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Sat, 6 Jan 2007 15:31:39 +0000 (15:31 +0000)
RELEASE-NOTES
includes/Exif.php
languages/messages/MessagesEn.php

index 7831b8c..192b7b5 100644 (file)
@@ -469,6 +469,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   on upgrade.
 * Recentchanges RSS/Atom feeds now use a separate message for the description
   to avoid cluttering it with useless wiki formatting
+* (bug 8417) Handle EXIF unknown dates
 
 
 == Languages updated ==
index e21b4d9..0860d5f 100644 (file)
@@ -731,7 +731,9 @@ class FormatExif {
                        case 'DateTime':
                        case 'DateTimeOriginal':
                        case 'DateTimeDigitized':
-                               if( preg_match( '/^(\d{4}):(\d\d):(\d\d) (\d\d):(\d\d):(\d\d)$/', $val ) ) {
+                               if( $val == '0000:00:00 00:00:00' ) {
+                                       $tags[$tag] = wfMsg('exif-unknowndate');
+                               } elseif( preg_match( '/^(\d{4}):(\d\d):(\d\d) (\d\d):(\d\d):(\d\d)$/', $val ) ) {
                                        $tags[$tag] = $wgLang->timeanddate( wfTimestamp(TS_MW, $val) );
                                }
                                break;
index fea5c66..3d9146d 100644 (file)
@@ -2384,6 +2384,8 @@ is collapsed. Others will be hidden by default.
 'exif-compression-1' => 'Uncompressed',
 'exif-compression-6' => 'JPEG',
 
+'exif-unknowndate' => 'Unknown date',
+
 'exif-photometricinterpretation-2' => 'RGB',
 'exif-photometricinterpretation-6' => 'YCbCr',