CodeIgniter Forums

Full Version: Issue with "font size" - Captcha helper
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]ojcarga[/eluser]
Hey guys,

I just found this little problem with setting the font size for the captcha helper, this is the current code and as it is right now, the font size that user set will never work

Code:
if ($use_font == FALSE)
{
        $font_size = 5;
        $x = rand(0, $img_width/($length/3));
        $y = 0;
}
else
{
        $font_size = 16;
        $x = rand(0, $img_width/($length/1.5));
        $y = $font_size+2;
}

I just added that piece of code to my project and it works very well, maybe that should be updated for next version of CI.


Code:
if(isset($data["font_size"]))
    $font_size = $data["font_size"]; //The font size value the user set
else
    $font_size = 16; //Default


if ($use_font == FALSE)
{
        ////$font_size = 5;
        $x = rand(0, $img_width/($length/3));
        $y = 0;
}
else
{
        ////$font_size = 16;
        $x = rand(0, $img_width/($length/1.5));
        $y = $font_size+2;
}

Hope I explained well... let me know what you think Smile

Cheers!