Index: trunk/phase3/includes/api/ApiWatch.php |
— | — | @@ -76,7 +76,11 @@ |
77 | 77 | |
78 | 78 | public function getAllowedParams() { |
79 | 79 | return array( |
80 | | - 'title' => null, |
| 80 | + 'title' => array( |
| 81 | + ApiBase::PARAM_TYPE => 'string', |
| 82 | + ApiBase::PARAM_REQUIRED => true |
| 83 | + ), |
| 84 | + |
81 | 85 | 'unwatch' => false, |
82 | 86 | ); |
83 | 87 | } |
Index: trunk/phase3/includes/api/ApiQueryCategoryMembers.php |
— | — | @@ -54,9 +54,6 @@ |
55 | 55 | private function run( $resultPageSet = null ) { |
56 | 56 | $params = $this->extractRequestParams(); |
57 | 57 | |
58 | | - if ( !isset( $params['title'] ) || is_null( $params['title'] ) ) { |
59 | | - $this->dieUsage( 'The cmtitle parameter is required', 'notitle' ); |
60 | | - } |
61 | 58 | $categoryTitle = Title::newFromText( $params['title'] ); |
62 | 59 | |
63 | 60 | if ( is_null( $categoryTitle ) || $categoryTitle->getNamespace() != NS_CATEGORY ) { |
— | — | @@ -208,7 +205,11 @@ |
209 | 206 | |
210 | 207 | public function getAllowedParams() { |
211 | 208 | return array( |
212 | | - 'title' => null, |
| 209 | + 'title' => array( |
| 210 | + ApiBase::PARAM_TYPE => 'string', |
| 211 | + ApiBase::PARAM_REQUIRED => true |
| 212 | + ), |
| 213 | + |
213 | 214 | 'prop' => array( |
214 | 215 | ApiBase::PARAM_DFLT => 'ids|title', |
215 | 216 | ApiBase::PARAM_ISMULTI => true, |
Index: trunk/phase3/includes/api/ApiQuerySearch.php |
— | — | @@ -58,10 +58,6 @@ |
59 | 59 | $searchInfo = array_flip( $params['info'] ); |
60 | 60 | $prop = array_flip( $params['prop'] ); |
61 | 61 | |
62 | | - if ( strval( $query ) === '' ) { |
63 | | - $this->dieUsage( 'empty search string is not allowed', 'param-search' ); |
64 | | - } |
65 | | - |
66 | 62 | // Create search engine instance and set options |
67 | 63 | $search = SearchEngine::create(); |
68 | 64 | $search->setLimitOffset( $limit + 1, $params['offset'] ); |
— | — | @@ -170,7 +166,10 @@ |
171 | 167 | |
172 | 168 | public function getAllowedParams() { |
173 | 169 | return array( |
174 | | - 'search' => null, |
| 170 | + 'search' => array( |
| 171 | + ApiBase::PARAM_TYPE => 'string', |
| 172 | + ApiBase::PARAM_REQUIRED => true |
| 173 | + ), |
175 | 174 | 'namespace' => array( |
176 | 175 | ApiBase::PARAM_DFLT => 0, |
177 | 176 | ApiBase::PARAM_TYPE => 'namespace', |
— | — | @@ -239,7 +238,6 @@ |
240 | 239 | |
241 | 240 | public function getPossibleErrors() { |
242 | 241 | return array_merge( parent::getPossibleErrors(), array( |
243 | | - array( 'code' => 'param-search', 'info' => 'empty search string is not allowed' ), |
244 | 242 | array( 'code' => 'search-text-disabled', 'info' => 'text search is disabled' ), |
245 | 243 | array( 'code' => 'search-title-disabled', 'info' => 'title search is disabled' ), |
246 | 244 | ) ); |