From 10d8daee2488a348bba301476b0f1881dae89203 Mon Sep 17 00:00:00 2001 From: Oldperl <44996956+oldperl@users.noreply.github.com> Date: Thu, 17 Nov 2011 15:15:17 +0000 Subject: [PATCH] bugfix: datetime::diff wont't work in PHP < 5.3, added version_compare --- output.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/output.php b/output.php index acd7e1e..a3d3b4c 100644 --- a/output.php +++ b/output.php @@ -14,8 +14,8 @@ */ $cfgMod = array( - 'debug' => true, - 'eak_imgset' => 'Extra/', + 'debug' => false, + 'eak_imgset' => 'default/', 'show_countdown' => true ); @@ -133,7 +133,7 @@ function daysdiff($dt1, $dt2, $timeZone = 'UTC') { // use the DateTime datediff function IF we have a non-buggy version // there is a bug in many Windows implementations that diff() always returns // 6015 - if( $dt1->diff($dt1)->format("%a") != 6015 ) { + if(version_compare(phpversion(), "5.3", ">=") && $dt1->diff($dt1)->format("%a") != 6015 ) { return $dt1->diff($dt2)->format("%a"); }