mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-11-15 20:09:25 +00:00
31c59374a4
Also update MathCaptcha so that it works with recent versions of Math (and breaks with old ones). Also fix MathCaptcha API output, which used to send the question in plaintext. Bug: T110302 Change-Id: I0da671a546700110d789b79a3089460abd9cce3b Depends-On: I8b52ec8ddf494f23941807638f149f15b5e46b0c
48 lines
984 B
PHP
48 lines
984 B
PHP
<?php
|
|
/**
|
|
* Api module to reload FancyCaptcha
|
|
*
|
|
* @ingroup API
|
|
* @ingroup Extensions
|
|
*/
|
|
class ApiFancyCaptchaReload extends ApiBase {
|
|
public function execute() {
|
|
# Get a new FancyCaptcha form data
|
|
$captcha = new FancyCaptcha();
|
|
$info = $captcha->getCaptcha();
|
|
$captchaIndex = $captcha->storeCaptcha( $info );
|
|
|
|
$result = $this->getResult();
|
|
$result->addValue( null, $this->getModuleName(), [ 'index' => $captchaIndex ] );
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* @deprecated since MediaWiki core 1.25
|
|
*/
|
|
public function getDescription() {
|
|
return 'Get a new FancyCaptcha.';
|
|
}
|
|
|
|
public function getAllowedParams() {
|
|
return [];
|
|
}
|
|
|
|
/**
|
|
* @deprecated since MediaWiki core 1.25
|
|
*/
|
|
public function getExamples() {
|
|
return [ 'api.php?action=fancycaptchareload&format=xml' ];
|
|
}
|
|
|
|
/**
|
|
* @see ApiBase::getExamplesMessages()
|
|
*/
|
|
protected function getExamplesMessages() {
|
|
return [
|
|
'action=fancycaptchareload'
|
|
=> 'apihelp-fancycaptchareload-example-1',
|
|
];
|
|
}
|
|
}
|