From 71fc4d3f85c016d0cc58d7cd79d9cd6eaa5ef74e Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 5 Feb 2006 01:07:28 +0000 Subject: [PATCH] * (bug 4867) Leave invalid EXIF date fields unformatted instead of showing a bogus current timestamp --- RELEASE-NOTES | 3 +++ includes/Exif.php | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 80572cd498..d5587ea42c 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/Exif.php b/includes/Exif.php index f7355f6ef6..33c6615b3a 100644 --- a/includes/Exif.php +++ b/includes/Exif.php @@ -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': -- 2.20.1