From d9022f63880ce039446fba8364f68e656b7bf4cb Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 3 May 2012 13:01:35 +0200 Subject: Update to MediaWiki 1.19.0 --- includes/media/FormatMetadata.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'includes/media/FormatMetadata.php') diff --git a/includes/media/FormatMetadata.php b/includes/media/FormatMetadata.php index 47fc1adc..91cb6914 100644 --- a/includes/media/FormatMetadata.php +++ b/includes/media/FormatMetadata.php @@ -233,10 +233,19 @@ class FormatMetadata { if ( $val == '0000:00:00 00:00:00' || $val == ' : : : : ' ) { $val = wfMsg( 'exif-unknowndate' ); } elseif ( preg_match( '/^(?:\d{4}):(?:\d\d):(?:\d\d) (?:\d\d):(?:\d\d):(?:\d\d)$/D', $val ) ) { + // Full date. $time = wfTimestamp( TS_MW, $val ); if ( $time && intval( $time ) > 0 ) { $val = $wgLang->timeanddate( $time ); } + } elseif ( preg_match( '/^(?:\d{4}):(?:\d\d):(?:\d\d) (?:\d\d):(?:\d\d)$/D', $val ) ) { + // No second field. Still format the same + // since timeanddate doesn't include seconds anyways, + // but second still available in api + $time = wfTimestamp( TS_MW, $val . ':00' ); + if ( $time && intval( $time ) > 0 ) { + $val = $wgLang->timeanddate( $time ); + } } elseif ( preg_match( '/^(?:\d{4}):(?:\d\d):(?:\d\d)$/D', $val ) ) { // If only the date but not the time is filled in. $time = wfTimestamp( TS_MW, substr( $val, 0, 4 ) @@ -1174,7 +1183,7 @@ class FormatMetadata { * Format a coordinate value, convert numbers from floating point * into degree minute second representation. * - * @param $coords Array: degrees, minutes and seconds + * @param $coord Array: degrees, minutes and seconds * @param $type String: latitude or longitude (for if its a NWS or E) * @return mixed A floating point number or whatever we were fed */ -- cgit v1.2.2