From: Bill S. <bi...@Sh...> - 2021-08-09 08:25:49
|
I left the line number off the error message because since I've added code, the line numbers won't be accurate. Two files are attached: date.php is the patched program. date.php.patch is the 'diff -u'; diff -u date.php.orig date.php > date.php.patch [0 12:47:56 root@yoda33 functions]$ cat /etc/redhat-release Fedora release 33 (Thirty Three) [0 12:51:13 root@yoda33 functions]$ rpm -q httpd dovecot postfix php httpd-2.4.46-9.fc33.x86_64 dovecot-2.3.14-1.fc33.x86_64 postfix-3.5.10-1.fc33.x86_64 php-7.4.19-1.fc33.x86_64 I added some debugging code in function getGMTSeconds starting at line 91 to see what the problem is (I've changed the username): [02-Aug-2021 06:49:56 America/Los_Angeles] Unrecognized time zone=+22:27 username=kermit [02-Aug-2021 06:49:56 America/Los_Angeles] PHP Warning: A non-numeric value encountered in /usr/local/src/squirrelmail-20210707_0200-SVN.stable/functions/date.php on line 96 [02-Aug-2021 06:49:57 America/Los_Angeles] Unrecognized time zone=+28 username=kermit [02-Aug-2021 06:49:57 America/Los_Angeles] PHP Warning: A non-numeric value encountered in /usr/local/src/squirrelmail-20210707_0200-SVN.stable/functions/date.php on line 96 [02-Aug-2021 06:49:57 America/Los_Angeles] Unrecognized time zone=+JULY username=kermit [02-Aug-2021 06:49:57 America/Los_Angeles] PHP Warning: A non-numeric value encountered in /usr/local/src/squirrelmail-20210707_0200-SVN.sta I realized something has gone wrong before getGMTSeconds is called. I added debugging code to function getTimeStamp starting at line 427: [05-Aug-2021 18:02:29 America/Los_Angeles] saveDateParts= Array ( [0] => TUESDAY [1] => [2] => [3] => [4] => JUNE [5] => 23 [6] => 2020 [7] => 21:50 ) Some of the array entries are empty. Added two lines of code to correct this; lines 428 & 429. It removes the empty array entries. [05-Aug-2021 19:09:41 America/Los_Angeles] saveDateParts= Array ( [0] => WEDNESDAY [1] => [2] => [3] => JUNE [4] => 17 [5] => 2020 [6] => 16:32 ) dateParts= Array ( [0] => WEDNESDAY [1] => JUNE [2] => 17 [3] => 2020 [4] => 16:32 ) The errors are gone now. I'm thinking this has something to do with this user's display preferences: Bill On 8/9/2021 12:49 AM, Paul Lesniewski wrote: > Hi Bill, > > On Mon, August 9, 2021 3:02 am, Bill Shirley wrote: >> I have a patch that fixes some invalid dates in date.php. Is this the >> place to post it? > Sure, thanks! > >> [02-Aug-2021 06:49:56 America/Los_Angeles] PHP Warning: A non-numeric >> value encountered in >> /usr/local/src/squirrelmail-20210707_0200-SVN.stable/functions/date.php > The error message should also say what the line number is, can you share > that? Also, what is the date string that caused this? > > Thanks! > |