CodeIgniter icon indicating copy to clipboard operation
CodeIgniter copied to clipboard

[BUG] Creating captcha in PHP 8.0

Open sunuazizrahayu opened this issue 1 year ago • 3 comments

Screenshot_2023-05-24_14-20-39

data type causing this

sunuazizrahayu avatar May 24 '23 07:05 sunuazizrahayu

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?

gxgpet avatar Jun 05 '23 10:06 gxgpet

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

sunuazizrahayu avatar Jun 06 '23 03:06 sunuazizrahayu

@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

privatecore avatar Mar 19 '24 12:03 privatecore