* (bug 4867) Leave invalid EXIF date fields unformatted instead of
authorBrion Vibber <brion@users.mediawiki.org>
Sun, 5 Feb 2006 01:07:28 +0000 (01:07 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sun, 5 Feb 2006 01:07:28 +0000 (01:07 +0000)
  showing a bogus current timestamp

RELEASE-NOTES
includes/Exif.php

index 80572cd..d5587ea 100644 (file)
@@ -593,6 +593,9 @@ fully support the editing toolbar, but was found to be too confusing.
   the default /favicon.ico or disable it (if set to false)
 * (bug 3347) strip linebreaks in math error source
 * (bug 4841) Warning for non-logged-in edits
+* (bug 4867) Leave invalid EXIF date fields unformatted instead of
+  showing a bogus current timestamp
+
 
 === Caveats ===
 
index f7355f6..33c6615 100644 (file)
@@ -724,7 +724,9 @@ class FormatExif {
                        case 'DateTime':
                        case 'DateTimeOriginal':
                        case 'DateTimeDigitized':
-                               $tags[$tag] = $wgLang->timeanddate( wfTimestamp(TS_MW, $val) );
+                               if( preg_match( "/^(\d{4}):(\d\d):(\d\d) (\d\d):(\d\d):(\d\d)$/", $val ) ) {
+                                       $tags[$tag] = $wgLang->timeanddate( wfTimestamp(TS_MW, $val) );
+                               }
                                break;
 
                        case 'ExposureProgram':