Turnstile's response field uses a static name instead of IDs

The script was originally looking for the field by ID. This resulted in an infinite challenge loop when saving edits through the VisualEditor.

This bug stopped our [wiki.gg] rollout of Turnstile over the network last week, so upstreaming this fix in case someone else needs it.

Bug: T361098
Change-Id: I0354a33d0d1af988c8788ad2bb021c585384b038
This commit is contained in:
alex4401 2024-06-25 03:05:49 +02:00
parent b17f585275
commit 92bcb7f2a2
No known key found for this signature in database
GPG key ID: D026E882D278EFB7

View file

@ -41,7 +41,7 @@ mw.loader.using( 'ext.visualEditor.targetLoader' ).then( () => {
// Register extra fields
target.saveFields.wpCaptchaWord = function () {
// eslint-disable-next-line no-jquery/no-global-selector
return $( '#cf-turnstile-response' ).val();
return $( 'input[ name="cf-turnstile-response" ]' ).val();
};
this.getReadyPromise()