Warnings due to the use of PHP 8.2 in server.php logs
<!-- Before creating a bug report, please: - Read the contribution guidelines: https://git.ispconfig.org/ispconfig/ispconfig3/-/blob/develop/CONTRIBUTING.md - Do not ask support questions here. If you are unsure if your problem is a bug, post a thread on the forum: https://www.howtoforge.com/community/#ispconfig-3.23 - Make sure to remove any content from the description that you did not add. For example, if there are no related log entries, remove the whole "Related log entries" part. --> ## Summary Hi, I'm getting the following errors in `/var/log/ispconfig/cron.log`: ``` Sun Nov 12 10:20:01 AM CET 2023 PHP Warning: Undefined array key "db_flags" in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 671 Sun Nov 12 10:20:03 AM CET 2023 PHP Warning: Undefined array key 1 in /usr/local/ispconfig/server/lib/classes/cron.d/100-monitor_mem_usage.inc.php on line 79 Sun Nov 12 10:20:03 AM CET 2023 PHP Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /usr/local/ispconfig/server/lib/classes/cron.d/100-monitor_mem_usage.inc.php on line 79 Sun Nov 12 10:21:01 AM CET 2023 finished server.php. ``` I've looked into `server/lib/classes/db_mysql.inc.php`, line 671: ``` $clientdb_flags = ($conf['db_flags'] !== NULL) ? $conf['db_flags'] : NULL; ``` which looks like the cause for the emitting of the 1st warning above, since I don't see 'db_flags' nowhere in any config file(s) defined, under `/usr/local/ispconfig`. It seems there should be an error control operator for suppressing errors/warnings (@) on that line, if we wanted to ignore the warning or the check should be written in a different way, to avoid having warning emitted in the first place (e.g. using `array_key_exists()` or so). I haven't created any PR for this since I'm not sure which way you guys want this to be solved (if at all). The 2nd warning seems to have the same traits as the 1st one. The 3rd warning is just an obsoletion warning, which could have slipped under your radar, I guess. Btw, thanks again for creating this great software :) :beers: Cheers. ## Steps to reproduce 1. Open the log at /var/log/ispconfig/cron.log 2. Inspect the log ## Correct behaviour There should be no errors/warnings in the log. ## Environment Server OS + version: **Debian GNU/Linux 12 (bookworm)** / ISPConfig version: **3.2.11p1** Software version of the related software: ``` Apache/2.4.57 PHP 8.2.7 ``` ## Related log entries ``` Sun Nov 12 10:20:01 AM CET 2023 PHP Warning: Undefined array key "db_flags" in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 671 Sun Nov 12 10:20:03 AM CET 2023 PHP Warning: Undefined array key 1 in /usr/local/ispconfig/server/lib/classes/cron.d/100-monitor_mem_usage.inc.php on line 79 Sun Nov 12 10:20:03 AM CET 2023 PHP Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /usr/local/ispconfig/server/lib/classes/cron.d/100-monitor_mem_usage.inc.php on line 79 Sun Nov 12 10:21:01 AM CET 2023 finished server.php. ```
issue