Page MenuHomePhabricator

API edit support for reCAPTCHA
Closed, ResolvedPublic


Author: Nx.devnull

ReCaptcha doesn't implement addCaptchaAPI, so it falls back to SimpleCaptcha, but then it still calls reCAPTCHA's passCaptcha function, so it's impossible to edit via api if the captcha is set to reCAPTCHA.

Version: unspecified
Severity: normal



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:52 PM
bzimport set Reference to bz31608.
bzimport added a subscriber: Unknown Object (MLST).

Nx.devnull wrote:

add api edit support

This patch implements addCaptchaAPI and removes ConfirmEdit, since it's unnecessary - it seems it was reimplemented in ReCaptcha to detect when the captcha had to be shown for the first time and not show an error message, but a minor change to passCaptcha ( if ( $response === null ) { return false; } ) accomplishes that.

Because the api edit module sets wpCaptchaId and wpCaptchaWord, those are passed to recaptcha as recaptcha_challenge_field and recaptcha_response_field if the latter two are not set. The api returns only the public key and the error message - the client can use this to ask the recaptcha server for a captcha, it works in javascript at least.


sumanah wrote:

Nikola, would you be interested in using developer access to submit this patch directly into Gerrit?

Closing, as this patch seems to have been applied in r104875.