Let wfTimestamp recognize negative unix timestamp values
authorBrian Wolff <bawolff@users.mediawiki.org>
Sat, 17 Jul 2010 23:29:20 +0000 (23:29 +0000)
committerBrian Wolff <bawolff@users.mediawiki.org>
Sat, 17 Jul 2010 23:29:20 +0000 (23:29 +0000)
RELEASE-NOTES
includes/GlobalFunctions.php

index b015cea..96f381a 100644 (file)
@@ -241,6 +241,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 24076) Recognize Office 2003 files with OpenXML trailers
 * (bug 24244) Updated comments in DefaultSettings.php to reflect Image: --> File:
   namespace rename.
+* Make wfTimestamp recognize negative unix timestamp values.
 
 === API changes in 1.17 ===
 * (bug 22738) Allow filtering by action type on query=logevent.
index bd9bc0f..6be53ad 100644 (file)
@@ -1892,7 +1892,7 @@ function wfTimestamp( $outputtype = TS_UNIX, $ts = 0 ) {
                # TS_EXIF
        } elseif (preg_match('/^(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)$/D',$ts,$da)) {
                # TS_MW
-       } elseif (preg_match('/^\d{1,13}$/D',$ts)) {
+       } elseif (preg_match('/^-?\d{1,13}$/D',$ts)) {
                # TS_UNIX
                $uts = $ts;
        } elseif (preg_match('/^\d{2}-\d{2}-\d{4} \d{2}:\d{2}:\d{2}.\d{6}$/', $ts)) {