Skip to content

Commit

Permalink
Issue #5096 - possible fix for older versions of PHP.
Browse files Browse the repository at this point in the history
  • Loading branch information
CaMer0n committed Nov 3, 2023
1 parent bfb515f commit 45661f4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion e107_admin/cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
);
Expand Down
4 changes: 3 additions & 1 deletion e107_handlers/Shims/Internal/StrftimeTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,13 @@ protected static function date_format($datetime, $format)
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
);
Expand Down
6 changes: 1 addition & 5 deletions e107_handlers/cron_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1223,16 +1223,12 @@ public function runJob($job)
{
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'];
Expand Down

0 comments on commit 45661f4

Please sign in to comment.