Index: trunk/phase3/includes/api/ApiParse.php |
— | — | @@ -134,7 +134,8 @@ |
135 | 135 | $main = new ApiMain( $req ); |
136 | 136 | $main->execute(); |
137 | 137 | $data = $main->getResultData(); |
138 | | - $redirValues = @$data['query']['redirects']; |
| 138 | + $redirValues = isset( $data['query']['redirects'] ) |
| 139 | + ? $data['query']['redirects'] : array(); |
139 | 140 | $to = $page; |
140 | 141 | foreach ( (array)$redirValues as $r ) { |
141 | 142 | $to = $r['to']; |
Index: trunk/phase3/includes/api/ApiQueryBacklinks.php |
— | — | @@ -305,7 +305,8 @@ |
306 | 306 | } |
307 | 307 | |
308 | 308 | $hasRedirs = false; |
309 | | - foreach ( (array)@$arr['redirlinks'] as $key => $redir ) { |
| 309 | + $redirLinks = isset( $arr['redirlinks'] ) ? $arr['redirlinks'] : array(); |
| 310 | + foreach ( (array)$redirLinks as $key => $redir ) { |
310 | 311 | $fit = $this->getResult()->addValue( |
311 | 312 | array( 'query', $this->getModuleName(), $pageID, 'redirlinks' ), |
312 | 313 | $key, $redir ); |
Index: trunk/phase3/includes/api/ApiQuery.php |
— | — | @@ -316,9 +316,8 @@ |
317 | 317 | * @param $moduleList Array array(modulename => classname) |
318 | 318 | */ |
319 | 319 | private function instantiateModules( &$modules, $param, $moduleList ) { |
320 | | - $list = @$this->params[$param]; |
321 | | - if ( !is_null ( $list ) ) { |
322 | | - foreach ( $list as $moduleName ) { |
| 320 | + if ( isset( $this->params[$param] ) ) { |
| 321 | + foreach ( $this->params[$param] as $moduleName ) { |
323 | 322 | $modules[] = new $moduleList[$moduleName] ( $this, $moduleName ); |
324 | 323 | } |
325 | 324 | } |
Index: trunk/phase3/includes/api/ApiQueryExternalLinks.php |
— | — | @@ -70,7 +70,8 @@ |
71 | 71 | } |
72 | 72 | |
73 | 73 | $this->addOption( 'LIMIT', $params['limit'] + 1 ); |
74 | | - if ( !is_null( $params['offset'] ) ) { |
| 74 | + $offset = isset( $params['offset'] ) ? $params['offset'] : 0; |
| 75 | + if ( $offset ) { |
75 | 76 | $this->addOption( 'OFFSET', $params['offset'] ); |
76 | 77 | } |
77 | 78 | |
— | — | @@ -81,14 +82,14 @@ |
82 | 83 | if ( ++$count > $params['limit'] ) { |
83 | 84 | // We've reached the one extra which shows that |
84 | 85 | // there are additional pages to be had. Stop here... |
85 | | - $this->setContinueEnumParameter( 'offset', @$params['offset'] + $params['limit'] ); |
| 86 | + $this->setContinueEnumParameter( 'offset', $offset + $params['limit'] ); |
86 | 87 | break; |
87 | 88 | } |
88 | 89 | $entry = array(); |
89 | 90 | ApiResult::setContent( $entry, $row->el_to ); |
90 | 91 | $fit = $this->addPageSubItem( $row->el_from, $entry ); |
91 | 92 | if ( !$fit ) { |
92 | | - $this->setContinueEnumParameter( 'offset', @$params['offset'] + $count - 1 ); |
| 93 | + $this->setContinueEnumParameter( 'offset', $offset + $count - 1 ); |
93 | 94 | break; |
94 | 95 | } |
95 | 96 | } |