Show
Ignore:
Timestamp:
07/08/2008 04:09:39 PM (3 months ago)
Author:
Geert
Message:

Cleaning up Captcha_Controller. Using in built in text::random() function. No more special characters, like $ or %, in captcha's anymore. Just a-z0-9.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/libraries/Captcha.php

    r2652 r3010  
    255255                { 
    256256                        $text_color = imageColorAllocate($this->image, mt_rand($color_limit + 8, 255), mt_rand($color_limit + 8, 255), mt_rand($color_limit + 8, 255)); 
    257                         $char = substr($chars, mt_rand(0,15), 1); 
    258                         imageTTFtext($this->image, mt_rand(23, 27), mt_rand(160, 200), mt_rand(-10, $this->width+10), mt_rand(-10, 60), $text_color, $font, $char); 
     257                        $char = substr($chars, mt_rand(0, 15), 1); 
     258                        imageTTFtext($this->image, mt_rand(23, 27), mt_rand(160, 200), mt_rand(-10, $this->width + 10), mt_rand(-10, 60), $text_color, $font, $char); 
    259259                } 
    260260 
     
    353353                for ($i = 0; $i <= $width; $i++) 
    354354                { 
    355                         $red   = $left_color[0] -floor($i*$color0); 
    356                         $green = $left_color[1] -floor($i*$color1); 
    357                         $blue  = $left_color[2] -floor($i*$color2); 
     355                        $red   = $left_color[0] - floor($i * $color0); 
     356                        $green = $left_color[1] - floor($i * $color1); 
     357                        $blue  = $left_color[2] - floor($i * $color2); 
    358358                        $col   = imagecolorallocate($this->image, $red, $green, $blue); 
    359359