match( $this->getRequest()->getIP() ) ) { $this->dieWithError( 'apierror-linter-invalid-ip', 'invalid-ip' ); } $params = $this->extractRequestParams(); $data = FormatJson::decode( $params['data'], true ); if ( !is_array( $data ) ) { $this->dieWithError( 'apierror-linter-invalid-data', 'invalid-data' ); } if ( Hooks::onParserLogLinterData( $params['page'], $params['revision'], $data ) ) { $this->getResult()->addValue( $this->getModuleName(), 'success', true ); } else { $this->dieWithError( 'apierror-linter-invalid-title', 'invalid-title' ); } } public function isInternal() { return true; } public function getAllowedParams() { return [ 'data' => [ ApiBase::PARAM_TYPE => 'string', ApiBase::PARAM_REQUIRED => true, ], 'page' => [ ApiBase::PARAM_TYPE => 'string', ApiBase::PARAM_REQUIRED => true, ], 'revision' => [ ApiBase::PARAM_TYPE => 'integer', ApiBase::PARAM_REQUIRED => true, ], ]; } }