From: Greg Sabino Mullane Date: Fri, 17 Nov 2006 20:52:00 +0000 (+0000) Subject: Fix (possibly temporary) for Postgres timestamp parsing issue. X-Git-Tag: 1.31.0-rc.0~55156 X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_add%27%29%20%7D%7D?a=commitdiff_plain;h=3f1dc32b1010be7c07e2d72249ae9a4748b0750f;p=lhc%2Fweb%2Fwiklou.git Fix (possibly temporary) for Postgres timestamp parsing issue. --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 38d89fd658..d6ee0d7846 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1317,6 +1317,10 @@ function wfTimestamp($outputtype=TS_UNIX,$ts=0) { # TS_POSTGRES $uts=gmmktime((int)$da[4],(int)$da[5],(int)$da[6], (int)$da[2],(int)$da[3],(int)$da[1]); + } elseif (preg_match("/^(\d{4})\-(\d\d)\-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/",$ts,$da)) { + # TS_POSTGRES + $uts=gmmktime((int)$da[4],(int)$da[5],(int)$da[6], + (int)$da[2],(int)$da[3],(int)$da[1]); } else { # Bogus value; fall back to the epoch... wfDebug("wfTimestamp() fed bogus time value: $outputtype; $ts\n");