summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2016-09-30 11:23:03 +0200
committerGitHub <noreply@github.com>2016-09-30 11:23:03 +0200
commit30a66c8cb47ef785b08843b7051b2003ed907246 (patch)
tree8a3fb42a7d47ed39daf40bdc381ee943ab5ef0d9 /system
parent49ef8402ffed15fd7d6cbf18f0dd5b04352344dd (diff)
parentbdf21c4e4cae0c232661f783c2f7070a03a7a912 (diff)
Merge pull request #4822 from gxgpet/develop
Fix PNG file deletion on captcha helper
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..f2ff4dccf 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);
}