WebsiteBaker Community Forum

WebsiteBaker Support (2.12.x) => General Help & Support => Topic started by: tobyw7 on November 11, 2020, 10:13:40 PM

Title: Captcha not loading
Post by: tobyw7 on November 11, 2020, 10:13:40 PM
Hi!

I have noticed the captcha has stopped loading

https://www.frantik-web.co.uk/pages/contact.php (https://www.frantik-web.co.uk/pages/contact.php)

I'm using MPForm for the form module.

Any ideas at all? I can't immediately see any errors in web console in Firefox.

Thx
Title: Re: Captcha not loading
Post by: dbs on November 11, 2020, 11:34:17 PM
Hi, what are your versions of WB, PHP and MPform?
What have you done before or what was your last changes?
Title: Re: Captcha not loading
Post by: Martin Hecht on November 12, 2020, 09:49:30 AM
there is a php warning from the captcha generator:
Code: [Select]
<br /><b>Deprecated</b>:  Array and string offset access syntax with curly braces is deprecated in <b>.../include/captcha/captchas/create_ttf_image.php</b> on line <b>60</b><br />With this output in the png file it is a corrupt image which the browser doesn't know how to render...
Title: Re: Captcha not loading
Post by: Luisehahne on November 12, 2020, 01:32:27 PM
in PHP 7.4 curly braces are deprecated. There are 2 files you have to fix.

search in /include/captcha/captchas/create_calc_ttf_image.php following line (should be line 70)
                $res = imagettftext($image, $ttfsize, $angle, $x, $y, $textcolor, $ttf, $text{$i});
and change to
                $res = imagettftext($image, $ttfsize, $angle, $x, $y, $textcolor, $ttf, $text[$i]);

and the same in /include/captcha/captchas/create_ttf_image.php following line (should be line 60)

Dietmar
Title: Re: Captcha not loading
Post by: tobyw7 on November 12, 2020, 07:18:47 PM
in PHP 7.4 curly braces are deprecated. There are 2 files you have to fix.

search in /include/captcha/captchas/create_calc_ttf_image.php following line (should be line 70)
                $res = imagettftext($image, $ttfsize, $angle, $x, $y, $textcolor, $ttf, $text{$i});
and change to
                $res = imagettftext($image, $ttfsize, $angle, $x, $y, $textcolor, $ttf, $text[$i]);

and the same in /include/captcha/captchas/create_ttf_image.php following line (should be line 60)

Dietmar


Thanks Dietmar, this fixed the problem :)
Title: Re: Captcha not loading
Post by: tobyw7 on November 12, 2020, 07:21:20 PM
Hi, what are your versions of WB, PHP and MPform?
What have you done before or what was your last changes?

For reference,

WB 2.12.2 r379
PHP 7.4
MPform 1.3.21
Title: Re: Captcha not loading
Post by: dbs on November 12, 2020, 07:30:22 PM
Our next WB version (https://wiki.WebsiteBaker.org/doku.php/downloads) will support PHP 7.4.
WB 2.12.2 is only for max PHP 7.3