summaryrefslogtreecommitdiffstats
path: root/system/helpers
diff options
context:
space:
mode:
authorGeorge Petculescu <gxgpet@gmail.com>2016-09-27 19:07:58 +0200
committerGeorge Petculescu <gxgpet@gmail.com>2016-09-27 19:07:58 +0200
commit6ed047335d216a74162aab488002239235dfe95e (patch)
treef7c7a8f51d0aa0ddb7fa9d9f74d763533132b649 /system/helpers
parentfd8d3987226bcde81db0682eee9c9acca0beb9a1 (diff)
- revert
Diffstat (limited to 'system/helpers')
-rw-r--r--system/helpers/captcha_helper.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php
index c2a1dcfbd..3c1e006f8 100644
--- a/system/helpers/captcha_helper.php
+++ b/system/helpers/captcha_helper.php
@@ -105,13 +105,12 @@ if ( ! function_exists('create_captcha'))
// Remove old images
// -----------------------------------
- $now = time();
+ $now = microtime(TRUE);
$current_dir = @opendir($img_path);
while ($filename = @readdir($current_dir))
{
- if (in_array(substr($filename, -4), array('.jpg', '.png'))
- && (filemtime($img_path.$filename) + $expiration) < $now)
+ if (substr($filename, -4) === '.jpg' && (str_replace('.jpg', '', $filename) + $expiration) < $now)
{
@unlink($img_path.$filename);
}
@@ -320,12 +319,12 @@ if ( ! function_exists('create_captcha'))
if (function_exists('imagejpeg'))
{
- $img_filename = sha1($now.$word).'.jpg';
+ $img_filename = $now.'.jpg';
imagejpeg($im, $img_path.$img_filename);
}
elseif (function_exists('imagepng'))
{
- $img_filename = sha1($now.$word).'.png';
+ $img_filename = $now.'.png';
imagepng($im, $img_path.$img_filename);
}
else