Jump to content

Topic on Extension talk:CIForms

Form Submission Error with Google reCAPTCHA

9
Aeyeu (talkcontribs)

I'm running MediaWiki 1.39.8 LTS with CIForms versions 1.3.0 from the REL1_39 branch on your GitHub, I'm running into the following error trying to implement a mail-in form with Google reCAPTCHA, "Form submission Captcha challenge not found. Please try again or contact admin@mywiki.wiki to receive support", I am using a CSP with the $wgCSPHeader header, it contains the following CSP declarations:


$wgCSPHeader = [

"useNonces" => false,

"script-src" => [

'\'self'',

'https://www.gstatic.com/recaptcha/',

'https://www.google.com/recaptcha/'

],

"default-src" => [

'\'self'',

'https://api.flickr.com'

],

"style-src" => [ '\'self\'' ],

"object-src" => [ '\'none\'' ]

];


And I have the following CIForms Config:


$wgCIFormsSenderEmail = "admin@mywiki.wiki";

$wgCIFormsSenderName = "Admin - My Wiki";

$wgCIFormsMailer = "smtp";

$wgCIFormsSMTPHost = "smtp.company.email";

$wgCIFormsSMTPUsername = "admin@mywiki.wiki";

$wgCIFormsSMTPPassword = "password";

$wgCIFormsSMTPPort - 587;

$wgCIFormsDataAccess = [ "bureaucrat", "administrators", "content-moderators" ];

$wgCIFormsGoogleRecaptchaSiteKey = "key";

$wgCIFormsGoogleRecaptchaSecret = "secret";


The Google ReCAPTCHA secret and site key are valid and I've double checked that, and I'm not sure what could be causing the issue, there's no errors reported in my web console, by apache, by my CSP or anything. Help would very much be appreciated, thanks!

Thomas-topway-it (talkcontribs)

@Aeyeu first of all can you try to install 1.3.2 ? thank you

Aeyeu (talkcontribs)

I did that, and it still is giving the same error, however with 1.3.2 I'm getting a composer requirement failure, which you may want to resolve.


"Root composer.json requires dompdf/dompdf ^1.0, ^3.0, found dompdf/dompdf[dev-rtl_language_support_and_computed_css, dev-resource-validation-updates, dev-vertical-align, dev-master, dev-rtl, dev-v2-maintenance, dev-stylesheet-parsing-updates, dev-develop, dev-paging-updates, v0.6.0, ..., v0.8.6, v1.0.0, ..., v1.2.2, v2.0.0, ..., v2.0.8, v3.0.0] but it does not match the constraint."

Thomas-topway-it (talkcontribs)

that seems strange, since composer requires dompdf/dompdf ^3.0

Thomas-topway-it (talkcontribs)

also there is this typo in your settings

 $wgCIFormsSMTPPort - 587; 
Aeyeu (talkcontribs)

Yeah I fixed that mistake after searching for solutions, for some reason randomly when I refreshed the page I got a captcha in front of every wiki element and at the top of the page, completing this did nothing to fix the issue, even when disabling my CSP the reCaptcha had failed to generate.

Thomas-topway-it (talkcontribs)
Aeyeu (talkcontribs)

Okay, what does this mean for me? Also are we able to get Cloudflare's Turnstile supported by chance?

Aeyeu (talkcontribs)

I swapped to reCAPTCHA V3 and I get a different error now, "[972bca6f451455c90a42dbd1] /w/Special:CIFormsSubmit TypeError: htmlspecialchars(): Argument #1 ($string) must be of type string, array given"

Reply to "Form Submission Error with Google reCAPTCHA"