Skip to content

Commit

Permalink
typo change
Browse files Browse the repository at this point in the history
Uses the same defaults as were hard coded in (8 chars in length,
0-9a-aA-Z). Small change in this file means less code elsewhere when
generating random character strings for the captcha word. all existing
code will work the same.
  • Loading branch information
ash committed Apr 10, 2013
1 parent 1aa336d commit 79dfac7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions system/helpers/captcha_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
*/
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, 'captcha_word_length' => 8, 'character_pool_for_generted_word' => '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ');
$defaults = array('word' => '', 'img_path' => '', 'img_url' => '', 'img_width' => '150', 'img_height' => '30', 'font_path' => '', 'expiration' => 7200, 'captcha_word_length' => 8, 'character_pool_for_generated_word' => '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ');

foreach ($defaults as $key => $val)
{
Expand Down Expand Up @@ -107,9 +107,9 @@ function create_captcha($data = '', $img_path = '', $img_url = '', $font_path =
if (empty($word))
{
$word = '';
for ($i = 0, $mt_rand_max = strlen($character_pool_for_generted_word) - 1; $i < $captcha_word_length; $i++)
for ($i = 0, $mt_rand_max = strlen($character_pool_for_generated_word) - 1; $i < $captcha_word_length; $i++)
{
$word .= $character_pool_for_generted_word[mt_rand(0, $mt_rand_max)];
$word .= $character_pool_for_generated_word[mt_rand(0, $mt_rand_max)];
}
}
elseif ( ! is_string($word))
Expand Down

0 comments on commit 79dfac7

Please sign in to comment.