From: Paul L. <pa...@sq...> - 2021-08-09 22:33:39
|
Bill, We need to see the origin of the problem, which in this case might be a strange date string from the IMAP server and/or in a date header. Your best place to debug is in functions/imap_messages.php around line 911. Can try doing: sm_print_r($internal_date, $date, '=========='); And you can make it conditional on the username if you know who is having the trouble. There are two lines with str_replace(' ', ' ', $internal_date); just below that which may need to be changed to use a regex: preg_replace('/\s+/', ' ', $internal_date); You can also use the info plugin and test some of your IMAP server responses. -- Paul Lesniewski SquirrelMail Team Please support Open Source Software by donating to SquirrelMail! http://squirrelmail.org/donate_paul_lesniewski.php On Mon, August 9, 2021 8:25 am, Bill Shirley wrote: > 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! >> > ----- > squirrelmail-devel mailing list > Posting guidelines: http://squirrelmail.org/postingguidelines > List address: squ...@li... > List archives: http://news.gmane.org/gmane.mail.squirrelmail.devel > List info (subscribe/unsubscribe/change options): > https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel |