summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
Diffstat (limited to 'system')
-rw-r--r--system/helpers/captcha_helper.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php
index 78e255a15..f3b9c6cc4 100644
--- a/system/helpers/captcha_helper.php
+++ b/system/helpers/captcha_helper.php
@@ -51,7 +51,7 @@ if ( ! function_exists('create_captcha'))
*/
function create_captcha($data = '', $img_path = '', $img_url = '', $font_path = '')
{
- $defaults = array('word' => '', 'img_path' => '', 'img_url' => '', 'img_width' => '150', 'img_height' => '30', 'font_path' => '', 'expiration' => 7200);
+ $defaults = array('word' => '', 'img_path' => '', 'img_url' => '', 'img_width' => '150', 'img_height' => '30', 'font_path' => '', 'expiration' => 7200, 'word_length' => 8, 'pool' => '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ');
foreach ($defaults as $key => $val)
{
@@ -95,9 +95,8 @@ if ( ! function_exists('create_captcha'))
if (empty($word))
{
- $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$word = '';
- for ($i = 0, $mt_rand_max = strlen($pool) - 1; $i < 8; $i++)
+ for ($i = 0, $mt_rand_max = strlen($pool) - 1; $i < $word_length; $i++)
{
$word .= $pool[mt_rand(0, $mt_rand_max)];
}