[Bug 265395] mail/squirrelmail: INBOX does not populate messages after upgrading php 7.4 to php 8.0

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 22 Jul 2022 23:29:44 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265395

            Bug ID: 265395
           Summary: mail/squirrelmail: INBOX does not populate messages
                    after upgrading php 7.4 to php 8.0
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: ports-bugs@FreeBSD.org
          Reporter: matt@snowtrek.org
                CC: uzsolt@uzsolt.hu
             Flags: maintainer-feedback?(uzsolt@uzsolt.hu)
                CC: uzsolt@uzsolt.hu

FreeBSD 12.3

After recently upgrading from php7.4 to php 8.0 I noticed that in Squirrelmail
my Inbox stopped populating messages. Other
folders(sent,junk,deleted,etc)continued to populate correctly. End-user is not
presented with any errors. Not all users experiencing the issue.

Error log shows:
[Fri Jul 22 2022] [php:error] [pid ] [client 192.] PHP Fatal error:  Uncaught
TypeError: Unsupported operand types: string * int in
squirrelmail/functions/date.php:91\nStack trace:\n#0
squirrelmail/functions/date.php(463): getGMTSeconds()\n#1
squirrelmail/functions/imap_messages.php(941): getTimeStamp()\n#2
squirrelmail/functions/mailbox_display.php(628):
sqimap_get_small_header_list()\n#3
squirrelmail/functions/mailbox_display.php(407): fillMessageArray()\n#4
squirrelmail/functions/mailbox_display.php(518): getSelfSortMessages()\n#5
squirrelmail/src/right_main.php(238): showMessagesForMailbox()\n#6 {main}\n 
thrown in squirrelmail/functions/date.php on line 91, referer: https://

I made the following change to date.php and everything started working again
and the errors no longer show in the log. I'm not sure if this is a proper way
to fix this bug.

date.php lines 89-91:

    -- $hh = substr($tzc,1,2);
    -- $mm = substr($tzc,3,2);
    ++ $hh = intval(substr($tzc,1,2));
    ++ $mm = intval(substr($tzc,3,2));
    $iTzc = ($hh * 60 + $mm) * 60;

-- 
You are receiving this mail because:
You are the assignee for the bug.