mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-11-24 00:04:15 +00:00
Adding MIME type to CAPTCHA API result per discussion on wikitech-l.
This commit is contained in:
parent
a808bd44dc
commit
2df8abceff
|
@ -83,6 +83,7 @@ class SimpleCaptcha {
|
|||
$captcha = $this->getCaptcha();
|
||||
$index = $this->storeCaptcha( $captcha );
|
||||
$resultArr['captcha']['type'] = 'simple';
|
||||
$resultArr['captcha']['mime'] = 'text/plain';
|
||||
$resultArr['captcha']['id'] = $index;
|
||||
$resultArr['captcha']['question'] = $captcha['question'];
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ class FancyCaptcha extends SimpleCaptcha {
|
|||
$index = $this->storeCaptcha( $info );
|
||||
$title = Title::makeTitle( NS_SPECIAL, 'Captcha/image' );
|
||||
$resultArr['captcha']['type'] = 'image';
|
||||
$resultArr['captcha']['mime'] = 'image/png';
|
||||
$resultArr['captcha']['id'] = $index;
|
||||
$resultArr['captcha']['url'] = $title->getLocalUrl( 'wpCaptchaId=' . urlencode( $index ) );
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ class MathCaptcha extends SimpleCaptcha {
|
|||
list( $sum, $answer ) = $this->pickSum();
|
||||
$index = $this->storeCaptcha( array('answer' => $answer ) );
|
||||
$resultArr['captcha']['type'] = 'math';
|
||||
$resultArr['captcha']['mime'] = 'text/tex';
|
||||
$resultArr['captcha']['id'] = $index;
|
||||
$resultArr['captcha']['question'] = $sum;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue