From 6332664540fc5529ba5d41d3d7a150bc5087dbb8 Mon Sep 17 00:00:00 2001 From: vkeranov Date: Thu, 12 Jul 2012 10:51:34 +0300 Subject: Fixed typo in the comments --- system/helpers/captcha_helper.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'system/helpers/captcha_helper.php') diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php index 4676b2a65..a4383c9d3 100644 --- a/system/helpers/captcha_helper.php +++ b/system/helpers/captcha_helper.php @@ -32,7 +32,7 @@ * @subpackage Helpers * @category Helpers * @author EllisLab Dev Team - * @link http://codeigniter.com/user_guide/helpers/xml_helper.html + * @link http://codeigniter.com/user_guide/helpers/captcha_helper.html */ // ------------------------------------------------------------------------ @@ -186,7 +186,6 @@ if ( ! function_exists('create_captcha')) } } - // Create the border imagerectangle($im, 0, 0, $img_width - 1, $img_height - 1, $border_color); -- cgit v1.2.3-24-g4f1b From 07cdcf8bb2af1c18aa93ea3c39bee8dcdf7d047e Mon Sep 17 00:00:00 2001 From: pickupman Date: Sun, 19 Aug 2012 15:33:43 -0400 Subject: Fixes issue #1678 --- system/helpers/captcha_helper.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'system/helpers/captcha_helper.php') diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php index a4383c9d3..57ef9e2fa 100644 --- a/system/helpers/captcha_helper.php +++ b/system/helpers/captcha_helper.php @@ -80,8 +80,7 @@ if ( ! function_exists('create_captcha')) $current_dir = @opendir($img_path); while ($filename = @readdir($current_dir)) { - if ($filename !== '.' && $filename !== '..' && $filename !== 'index.html' - && (str_replace('.jpg', '', $filename) + $expiration) < $now) + if (strpos($filename, ".jpg") !== FALSE && (str_replace('.jpg', '', $filename) + $expiration) < $now) { @unlink($img_path.$filename); } -- cgit v1.2.3-24-g4f1b From 5f385d0089229acf5ba317dca0c91457d14d797f Mon Sep 17 00:00:00 2001 From: vlakoff Date: Sun, 2 Sep 2012 23:00:25 +0200 Subject: Slightly robuster test Also, single quotes per style conventions --- system/helpers/captcha_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers/captcha_helper.php') diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php index 57ef9e2fa..3aac14db8 100644 --- a/system/helpers/captcha_helper.php +++ b/system/helpers/captcha_helper.php @@ -80,7 +80,7 @@ if ( ! function_exists('create_captcha')) $current_dir = @opendir($img_path); while ($filename = @readdir($current_dir)) { - if (strpos($filename, ".jpg") !== FALSE && (str_replace('.jpg', '', $filename) + $expiration) < $now) + if (substr($filename, -4) === '.jpg' && (str_replace('.jpg', '', $filename) + $expiration) < $now) { @unlink($img_path.$filename); } -- cgit v1.2.3-24-g4f1b