• Resolved dawnmew

    (@dawnmew)


    Some of you may have noticed that Really Simple CAPTCHA (and, by extension, the CAPTCHA system in Contact Form 7) is outputting solid black images, with no visible codes on them, thus making them pretty unusable.

    I traced the issue back to a function used by Really Simple CAPTCHA, and luckily, it’s easy to fix.

    Go to your Plugins page and choose to “Edit” Really Simple CAPTCHA.

    Find this line: imagefill( $im, 0, 0, $bg );

    Replace it with this line: imagefilledrectangle($im,0,0,$this->img_size[0]-1,$this->img_size[1]-1,$bg);

    Save the changes. It should be fixed.

    This issue is caused by imagefill(), which was buggy in certain versions of PHP, especially the earlier 5.2.* versions. Replacing it with an equivalent imagefilledrectangle() call fixes the issue, at least until you upgrade again.

    If the plugin author is reading this, please consider replacing imagefill() with imagefilledrectangle() in the plugin — imagefill() was broken in several PHP versions, while imagefilledrectangle() has always worked correctly.

    http://wordpress.org/extend/plugins/contact-form-7/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    Note: The current version of Really Simple CAPTCHA and Contact Form 7 require WordPress 3.2 or higher. WordPress 3.2 requires PHP 5.2.4 or higher. So now it’s very rare to see that kind of trouble.

    ddust984

    (@ddust984)

    Well done man yous ave me!

    Thread Starter dawnmew

    (@dawnmew)

    @takayuki: My server runs 5.2.6 and I’m using the most recent version of WordPress (3.3.1), and I encountered the problem there anyway. I’m not completely sure which version this bug was fixed in, but it’s still in circulation.

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    If you know some official reports state that it’s due to a bug of imagefill in some versions of PHP and you can fix it by using imagefilledrectangle instead, please let me know that. Without them I won’t replace them in the plugin code. It might be more buggy, right?

    Thread Starter dawnmew

    (@dawnmew)

    @takayuki: Details are sporadic, but imagefill has been the subject of several bugs fixed between 5.2.4 and now.

    https://bugs.php.net/bug.php?id=51128
    https://bugs.php.net/bug.php?id=51671
    https://bugs.php.net/bug.php?id=60160

    Admittedly none of these specify my exact problem, but it sounds like it’s probably the same root cause. In all cases, imagefilledrectangle() has worked as a substitute, and in one of those, was the suggested workaround until the patch.

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    Thank you for the information. I’ll check them.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: Contact Form 7] How to fix solid black images from Really Simple CAPTCHA’ is closed to new replies.