summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorGeorge Petculescu <gxgpet@gmail.com>2016-09-27 19:25:43 +0200
committerGeorge Petculescu <gxgpet@gmail.com>2016-09-27 19:25:43 +0200
commit89eb04b5f09f4d7fb2d319e417bc188f0ed915d0 (patch)
treed338d4e04ead1c823326c61381febc411f327578 /system
parent6ed047335d216a74162aab488002239235dfe95e (diff)
- captcha helper will now look for .png files too when deleting old files
Diffstat (limited to 'system')
-rw-r--r--system/helpers/captcha_helper.php3
1 files changed, 2 insertions, 1 deletions
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);
}