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
Bug: T368852
Change-Id: I0354a33d0d1af988c8788ad2bb021c585384b038
(cherry picked from commit 92bcb7f2a2)
This commit is contained in:
alex4401 2024-06-25 03:05:49 +02:00 committed by Reedy
parent c52cc04a3f
commit 317d472e8a

View file

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