summaryrefslogtreecommitdiffstats
path: root/system/helpers/captcha_helper.php
diff options
context:
space:
mode:
authorMichiel Vugteveen <michiel@it-can.nl>2012-03-07 21:34:52 +0100
committerMichiel Vugteveen <michiel@it-can.nl>2012-03-07 21:34:52 +0100
commitc2659b8e91afd0af69b371c0ad92e6b1be99a5e9 (patch)
tree0b5cc041a6f2ded7133336c5eab0cc0cb198d7b7 /system/helpers/captcha_helper.php
parent8e0ea9f64fa452c9ec04fc3f16bc571274ee1552 (diff)
fix + style fix
Diffstat (limited to 'system/helpers/captcha_helper.php')
-rw-r--r--system/helpers/captcha_helper.php13
1 files changed, 6 insertions, 7 deletions
diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php
index 668b034d4..4a48df27e 100644
--- a/system/helpers/captcha_helper.php
+++ b/system/helpers/captcha_helper.php
@@ -5,9 +5,9 @@
* An open source application development framework for PHP 5.1.6 or newer
*
* NOTICE OF LICENSE
- *
+ *
* Licensed under the Open Software License version 3.0
- *
+ *
* This source file is subject to the Open Software License (OSL 3.0) that is
* bundled with this package in the files license.txt / license.rst. It is
* also available through the world wide web at this URL:
@@ -94,16 +94,15 @@ if ( ! function_exists('create_captcha'))
// Remove old images
// -----------------------------------
- list($usec, $sec) = explode(" ", microtime());
- $now = ((float)$usec + (float)$sec);
+ $now = microtime(TRUE);
$current_dir = @opendir($img_path);
while ($filename = @readdir($current_dir))
{
- if ($filename != "." and $filename != ".." and $filename != "index.html")
+ if ($filename != '.' && $filename != '..' && $filename != 'index.html')
{
- $name = str_replace(".jpg", "", $filename);
+ $name = str_replace('.jpg', '', $filename);
if (($name + $expiration) < $now)
{
@@ -198,7 +197,7 @@ if ( ! function_exists('create_captcha'))
// Write the text
// -----------------------------------
- $use_font = ($font_path != '' AND file_exists($font_path) AND function_exists('imagettftext')) ? TRUE : FALSE;
+ $use_font = ($font_path != '' && file_exists($font_path) && function_exists('imagettftext')) ? TRUE : FALSE;
if ($use_font == FALSE)
{