summaryrefslogtreecommitdiffstats
path: root/system/helpers
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2016-09-30 11:23:03 +0200
committerAndrey Andreev <narf@devilix.net>2016-09-30 11:23:58 +0200
commit7e669e67636a1d5cb10fa4288cdb9b0c39ad2124 (patch)
tree4669646761e098b53d26ca30b6c4ffa38517cd9e /system/helpers
parent8a15f5af819424087b6676709d98de6fa5fc6115 (diff)
Merge pull request #4822 from gxgpet/develop
Fix PNG file deletion on captcha helper
Diffstat (limited to 'system/helpers')
-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);
}