Adding MIME type to CAPTCHA API result per discussion on wikitech-l.

This commit is contained in:
Roan Kattouw 2008-02-29 21:44:21 +00:00
parent a808bd44dc
commit 2df8abceff
3 changed files with 3 additions and 0 deletions

View file

@ -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'];
}

View file

@ -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 ) );
}

View file

@ -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;
}