bcit-ci / CodeIgniter

Open Source PHP Framework (originally from EllisLab)
https://codeigniter.com/
MIT License
18.28k stars 7.61k forks source link

[BUG] Creating captcha in PHP 8.0 #6215

Open sunuazizrahayu opened 1 year ago

sunuazizrahayu commented 1 year ago

Screenshot_2023-05-24_14-20-39

data type causing this

gxgpet commented 1 year ago

There's nothing on that line... Most probably you don't have the latest version of the framework.

Can you please provide the contents of that line from your CodeIgniter installation? What's causing this?

sunuazizrahayu commented 1 year ago

There's nothing on that line... Most probably you don't have the latest version of the framework.

Can you please provide the contents of that line from your CodeIgniter installation? What's causing this?

it might have patched. i use 3.1.13

privatecore commented 6 months ago

@sunuazizrahayu https://github.com/bcit-ci/CodeIgniter/blob/3.1-stable/system/helpers/captcha_helper.php#L125

replace if statement with:

if (in_array(substr($filename, -4), array('.jpg', '.png'))
    && (intval(str_replace(array('.jpg', '.png'), '', $filename)) + $expiration) < $now)
{
    @unlink($img_path.$filename);
}

this error occurs in the php8 when you're trying to add string to integer