mediawiki-extensions-Confir.../ApiFancyCaptchaReload.php
Timo Tijhof d80a768c97 ApiFancyCaptchaReload: Replace use of PHP shorttag
Some servers (mine apparently) disable short_open_tag which
causes this to break and output the PHP file as plain text.

Scanned repo for other uses, this is the last one.

Change-Id: Ic86ae887098fc92bad8128e7ef4f0f4b782d7a1c
2013-06-28 16:18:10 -07:00

35 lines
729 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();
$captchaIndex = $captcha->getCaptchaIndex();
$result = $this->getResult();
$result->addValue( null, $this->getModuleName(), array ( 'index' => $captchaIndex ) );
return true;
}
public function getDescription() {
return 'Get a new FancyCaptcha.';
}
public function getAllowedParams() {
return array();
}
public function getParamDescription() {
return array();
}
public function getExamples() {
return array( 'api.php?action=fancycaptchareload&format=xml' );
}
}