mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-12-02 17:46:30 +00:00
3aa76b0f5f
Since this extension uses extension.json, it already requires 1.25+ so no need to keep the old code around. Change-Id: I6f968be3b7ef7cbc7193c8e103beb36ecf9c7b60
30 lines
670 B
PHP
30 lines
670 B
PHP
<?php
|
|
|
|
class ApiAbuseFilterEvalExpression extends ApiBase {
|
|
public function execute() {
|
|
$params = $this->extractRequestParams();
|
|
|
|
$result = AbuseFilter::evaluateExpression( $params['expression'] );
|
|
|
|
$this->getResult()->addValue( null, $this->getModuleName(), array( 'result' => $result ) );
|
|
}
|
|
|
|
public function getAllowedParams() {
|
|
return array(
|
|
'expression' => array(
|
|
ApiBase::PARAM_REQUIRED => true,
|
|
),
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @see ApiBase::getExamplesMessages()
|
|
*/
|
|
protected function getExamplesMessages() {
|
|
return array(
|
|
'action=abusefilterevalexpression&expression=lcase("FOO")'
|
|
=> 'apihelp-abusefilterevalexpression-example-1',
|
|
);
|
|
}
|
|
}
|