Roundcube Community Forum

 

PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type s

Started by mulyadi20, December 16, 2023, 01:47:12 AM

Previous topic - Next topic

mulyadi20

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


mulyadi20

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;
        }
    }

alec

This is not an error causing 500, you have to look for a real error in logs, not a deprecation warning.