From 45661f44c3b9692cb36a9828797ea73b95559670 Mon Sep 17 00:00:00 2001 From: camer0n Date: Fri, 3 Nov 2023 16:07:00 -0700 Subject: [PATCH] Issue #5096 - possible fix for older versions of PHP. --- e107_admin/cron.php | 2 +- e107_handlers/Shims/Internal/StrftimeTrait.php | 4 +++- e107_handlers/cron_class.php | 6 +----- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/e107_admin/cron.php b/e107_admin/cron.php index 726b6e9e0..32a8a494b 100644 --- a/e107_admin/cron.php +++ b/e107_admin/cron.php @@ -68,7 +68,7 @@ class cron_admin_ui extends e_admin_ui 'cron_description' => array('title'=> LAN_DESCRIPTION, 'type' => 'text', 'data'=>'str', 'width' => '35%', 'readonly' => 1), 'cron_function' => array('title'=> LAN_CRON_2, 'type' => 'text', 'data'=>'str', 'width' => 'auto', 'thclass' => 'left first', 'readonly' => 1), 'cron_tab' => array('title'=> LAN_CRON_3, 'type' => 'method', 'width' => 'auto'), // Display name - 'cron_lastrun' => array('title'=> LAN_CRON_4, 'type' => 'datestamp', 'data' => 'int', 'width' => 'auto', 'readonly' => 2), + 'cron_lastrun' => array('title'=> LAN_CRON_4, 'type' => 'datestamp', 'data' => 'int', 'width' => 'auto', 'readonly' => 2, 'readParms'=>['mask'=>'dd MM yyyy hh:ii:ss']), 'cron_active' => array('title'=> LAN_ACTIVE, 'type' => 'boolean', 'data'=> 'int', 'thclass' => 'center', 'class'=>'center', 'filter' => true, 'batch' => true, 'width' => 'auto'), 'options' => array('title'=> LAN_OPTIONS, 'type' => 'method', 'data'=> null, 'noedit'=>TRUE, 'forced'=>TRUE, 'width' => '10%', 'thclass' => 'center last', 'class' => 'right') ); diff --git a/e107_handlers/Shims/Internal/StrftimeTrait.php b/e107_handlers/Shims/Internal/StrftimeTrait.php index bfa5083c3..387eb8ef0 100644 --- a/e107_handlers/Shims/Internal/StrftimeTrait.php +++ b/e107_handlers/Shims/Internal/StrftimeTrait.php @@ -65,11 +65,13 @@ trait StrftimeTrait return date_format($datetime, $format); } + + $timezone = 'GMT'.date('O'); $formatter = new \IntlDateFormatter( self::getSensibleLocale(), \IntlDateFormatter::NONE, \IntlDateFormatter::NONE, - 'GMT'.date('O'), // More accurate timezone. @see https://stackoverflow.com/questions/31707395/why-php-intldateformatter-returns-wrong-date-1-hour + $timezone, // More accurate timezone. @see https://stackoverflow.com/questions/31707395/why-php-intldateformatter-returns-wrong-date-1-hour null, $format ); diff --git a/e107_handlers/cron_class.php b/e107_handlers/cron_class.php index bbc5a2266..0eb14d215 100644 --- a/e107_handlers/cron_class.php +++ b/e107_handlers/cron_class.php @@ -1223,16 +1223,12 @@ class cronScheduler { if($this->debug) { - $this->cron->debug('e107: Cron could not find method: '.$job['function'], E_ERROR); + $this->cron->debug('Cron could not find method: '.$job['function'], E_ERROR); } return $status; } - if($this->debug) - { - $this->cron->debug('e107: Cron could not find method: '.$class . "::" . $job['function'].'()', E_NOTICE); - } // Exception handling. $method = $job['function'];