extractRequestParams(); $matches = BaseBlacklist::getInstance( 'spam' )->filter( $params['url'], null, true ); $res = $this->getResult(); if ( $matches !== false ) { // this url is blacklisted. $res->addValue( 'spamblacklist', 'result', 'blacklisted' ); $res->setIndexedTagName( $matches, 'match' ); $res->addValue( 'spamblacklist', 'matches', $matches ); } else { // not blacklisted $res->addValue( 'spamblacklist', 'result', 'ok' ); } } public function getAllowedParams() { return array( 'url' => array( ApiBase::PARAM_REQUIRED => true, ApiBase::PARAM_ISMULTI => true, ) ); } /** * @see ApiBase::getExamplesMessages() */ protected function getExamplesMessages() { return array( 'action=spamblacklist&url=http://www.example.com/|http://www.example.org/' => 'apihelp-spamblacklist-example-1', ); } public function getHelpUrls() { return array( 'https://www.mediawiki.org/wiki/Extension:SpamBlacklist/API' ); } }