public function execute() {
$params = $this->extractRequestParams();
$search = $params['search'];
+ $limit = intval( $params['limit'] );
+ if( $limit < 1 || $limit > 100 ) {
+ $limit = 10;
+ }
// Open search results may be stored for a very long time
$this->getMain()->setCacheMaxAge(1200);
'action' => 'query',
'list' => 'allpages',
'apnamespace' => $title->getNamespace(),
- 'aplimit' => 10,
+ 'aplimit' => $limit,
'apprefix' => $title->getDBkey()
));
protected function getAllowedParams() {
return array (
- 'search' => null
+ 'search' => null,
+ 'limit' => 10
);
}
protected function getParamDescription() {
return array (
- 'search' => 'Search string'
+ 'search' => 'Search string',
+ 'limit' => 'Optional limit (default 10)'
);
}