From e6984bae9d260e33b856d05106420623340d11a8 Mon Sep 17 00:00:00 2001 From: delcroix Patrick Date: Sun, 8 Mar 2015 12:37:07 +0100 Subject: [PATCH] FIX: jdate returning -62169955200 on x64 machine on x64 machine jdate return -62169955200 instead of 0 when the input is 00-00-00 00:00:00 or equivalent same issue for mktime https://bugs.php.net/bug.php?id=53662 --- htdocs/core/db/DoliDB.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index 67e3022d6e3..c689e49b85e 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -274,6 +274,8 @@ abstract class DoliDB implements Database */ function jdate($string, $gm=false) { + if($string==0 || $string=="0000-00-00 00:00:00") + return NULL; $string=preg_replace('/([^0-9])/i','',$string); $tmp=$string.'000000'; $date=dol_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4),$gm);