From: Brian Wolff Date: Sat, 17 Jul 2010 23:29:20 +0000 (+0000) Subject: Let wfTimestamp recognize negative unix timestamp values X-Git-Tag: 1.31.0-rc.0~36112 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/ajouter.php?a=commitdiff_plain;h=ab0055309056826359f019d3d93fb0dd6b4fb3f1;p=lhc%2Fweb%2Fwiklou.git Let wfTimestamp recognize negative unix timestamp values --- 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)) {