From 89eb04b5f09f4d7fb2d319e417bc188f0ed915d0 Mon Sep 17 00:00:00 2001 From: George Petculescu Date: Tue, 27 Sep 2016 20:25:43 +0300 Subject: - captcha helper will now look for .png files too when deleting old files --- system/helpers/captcha_helper.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php index 3c1e006f8..f6c42b4f7 100644 --- a/system/helpers/captcha_helper.php +++ b/system/helpers/captcha_helper.php @@ -110,7 +110,8 @@ if ( ! function_exists('create_captcha')) $current_dir = @opendir($img_path); while ($filename = @readdir($current_dir)) { - if (substr($filename, -4) === '.jpg' && (str_replace('.jpg', '', $filename) + $expiration) < $now) + if (in_array(substr($filename, -4), array('.jpg', '.png')) + && (str_replace(array('.jpg', '.png'), '', $filename) + $expiration) < $now) { @unlink($img_path.$filename); } -- cgit v1.2.3-24-g4f1b