From ab0055309056826359f019d3d93fb0dd6b4fb3f1 Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Sat, 17 Jul 2010 23:29:20 +0000 Subject: [PATCH] Let wfTimestamp recognize negative unix timestamp values --- RELEASE-NOTES | 1 + includes/GlobalFunctions.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index b015cea5da..96f381aeb7 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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. diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index bd9bc0f6cf..6be53ad0c6 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -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)) { -- 2.20.1