Index: trunk/phase3/includes/api/ApiQueryBacklinks.php |
— | — | @@ -102,7 +102,7 @@ |
103 | 103 | |
104 | 104 | $redirect = $this->params['redirect']; |
105 | 105 | if ($redirect) |
106 | | - ApiBase :: dieDebug(__METHOD__, 'Redirect has not been implemented', 'notimplemented'); |
| 106 | + $this->dieDebug('Redirect has not been implemented', 'notimplemented'); |
107 | 107 | |
108 | 108 | $this->processContinue(); |
109 | 109 | |
— | — | @@ -124,13 +124,15 @@ |
125 | 125 | $this->addWhereFld($this->bl_title, $this->rootTitle->getDBkey()); |
126 | 126 | $this->addWhereFld('page_namespace', $this->params['namespace']); |
127 | 127 | |
| 128 | + if($this->params['filterredir'] == 'redirects') |
| 129 | + $this->addWhereFld('page_is_redirect', 1); |
| 130 | + if($this->params['filterredir'] == 'nonredirects') |
| 131 | + $this->addWhereFld('page_is_redirect', 0); |
| 132 | + |
128 | 133 | $limit = $this->params['limit']; |
129 | 134 | $this->addOption('LIMIT', $limit +1); |
130 | 135 | $this->addOption('ORDER BY', $this->bl_sort); |
131 | 136 | |
132 | | - if ($redirect) |
133 | | - $this->addWhereFld('page_is_redirect', 0); |
134 | | - |
135 | 137 | $db = $this->getDB(); |
136 | 138 | if (!is_null($this->params['continue'])) { |
137 | 139 | $plfrm = intval($this->contID); |
— | — | @@ -322,6 +324,14 @@ |
323 | 325 | ApiBase :: PARAM_ISMULTI => true, |
324 | 326 | ApiBase :: PARAM_TYPE => 'namespace' |
325 | 327 | ), |
| 328 | + 'filterredir' => array( |
| 329 | + ApiBase :: PARAM_DFLT => 'all', |
| 330 | + ApiBase :: PARAM_TYPE => array( |
| 331 | + 'all', |
| 332 | + 'redirects', |
| 333 | + 'nonredirects' |
| 334 | + ) |
| 335 | + ), |
326 | 336 | 'redirect' => false, |
327 | 337 | 'limit' => array ( |
328 | 338 | ApiBase :: PARAM_DFLT => 10, |
— | — | @@ -338,6 +348,7 @@ |
339 | 349 | 'title' => 'Title to search. If null, titles= parameter will be used instead, but will be obsolete soon.', |
340 | 350 | 'continue' => 'When more results are available, use this to continue.', |
341 | 351 | 'namespace' => 'The namespace to enumerate.', |
| 352 | + 'filterredir' => 'How to filter for redirects', |
342 | 353 | 'redirect' => 'If linking page is a redirect, find all pages that link to that redirect (not implemented)', |
343 | 354 | 'limit' => 'How many total pages to return.' |
344 | 355 | ); |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -497,6 +497,7 @@ |
498 | 498 | * (bug 11115) Adding SHA1 hash to imageinfo query |
499 | 499 | * (bug 10898) API does not return an edit token for non-existent pages |
500 | 500 | * (bug 10890) Timestamp support for categorymembers query |
| 501 | +* (bug 10980) Add exclude redirects on backlinks |
501 | 502 | |
502 | 503 | == Maintenance script changes since 1.10 == |
503 | 504 | |