Skip to main content
Cronjob to email_imap_cron.php yields error in v1.1.9 Started by rjm · · Read 9361 times 0 Members and 1 Guest are viewing this topic. previous topic - next topic

Cronjob to email_imap_cron.php yields error in v1.1.9

Recently, a "custom" strftime()-function has been appended to Subs.php (because of "deprecated" state).
However, when the cronjob to email_imap_cron.php is executed, the following error is reported:

PHP Catchable fatal error:  Argument 1 passed to Util::strftime() must be an instance of string, string given, called in /var/www/virtual/prorad-dn.de/forum/htdocs/elk/sources/Subs.php on line 483 and defined in /var/www/virtual/prorad-dn.de/forum/htdocs/elk/sources/subs/Util.class.php on line 593

The git repo shows that Subs.php's last update was per commit of 2022-08-22. So I think that applying patch 1.1.10 would not fix this.

Re: Cronjob to email_imap_cron.php yields error in v1.1.9

Reply #1

Thank you for the report !   I'll take a look

Re: Cronjob to email_imap_cron.php yields error in v1.1.9

Reply #2

I've not yet been able to track this down. 

Do you have the full trace in the error log?  I need to find where standardTime() was called from and how it has bad parameters. 

Was this a PBE topic reply, PM or a new topic?  Could you share the raw email (just need the headers) in case the email parser grabbed some incorrect date/time from the email.  Its probably going to be one of those easy to fix but hard to trace type of issues.

Also, thinking about this, what version of PHP are you running?
Last Edit: June 30, 2023, 01:47:09 pm by Spuds

Re: Cronjob to email_imap_cron.php yields error in v1.1.9

Reply #3

Looking at the error that’s pre PHP 7.0. As that’s when string was added as a named type.


 

Re: Cronjob to email_imap_cron.php yields error in v1.1.9

Reply #5

Quote from: ahrasis – I think strftime()-function is deprecated in php8.1 so this may be new or overlooked.

This is some ideas to go about it: https://stackoverflow.com/questions/70930824/php-8-1-strftime-is-deprecated

I introduced a function in Util to mitigate that, the function is what’s throwing the error.

The only way I can recreate it currently is by running PHP 5.6