Adding MIME type to CAPTCHA API result per discussion on wikitech-l.
authorRoan Kattouw <catrope@users.mediawiki.org>
Fri, 29 Feb 2008 21:44:21 +0000 (21:44 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Fri, 29 Feb 2008 21:44:21 +0000 (21:44 +0000)
ConfirmEdit_body.php
FancyCaptcha.class.php
MathCaptcha.class.php

index e905640cf23b8bafb119fecba564e462a397effc..0926cacd30ef436064a133a19138ae16bed452cd 100644 (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'];
        }
index b560e712e0685422dc856c3a4dbebd56c43a170b..cf723d76315704bd67b4c4bbe1ab153059ace8ac 100644 (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 ) );             
        }
index db506a335451b784ea1764057a202942fcf25590..66567e03503495846d449beb17a4e463030ce78c 100644 (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;
        }