Roundcube Community Forum

Miscellaneous => Roundcube Discussion => Topic started by: mulyadi20 on December 16, 2023, 01:47:12 AM

Title: PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type s
Post by: mulyadi20 on December 16, 2023, 01:47:12 AM
Hi All,

i used roundcube v1.6 in AlmaLinux9 with PHP8.1 cPanel and when i open webmail show error internal server error 500

this is logs tail /home/users/logs/.php.error.log

PHP Deprecated:  preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /usr/local/cpanel/base/3rdparty/roundcube/program/lib/Roundcube/bootstrap.php on line 155

Please any advice how to fix this error

Thanks

Title: Re: PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type s
Post by: mulyadi20 on December 16, 2023, 01:49:08 AM
this line 155

   if (preg_match('/([0-9\.]+)\s*([a-z]*)/i', $str, $regs)) {


        $bytes = floatval($regs[1]);
        switch (strtolower($regs[2])) {
        case 'g':
        case 'gb':
            $bytes *= 1073741824;
            break;
        case 'm':
        case 'mb':
            $bytes *= 1048576;
            break;
        case 'k':
        case 'kb':
            $bytes *= 1024;
            break;
        }
    }
Title: Re: PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type s
Post by: alec on December 17, 2023, 07:57:12 AM
This is not an error causing 500, you have to look for a real error in logs, not a deprecation warning.