Index: trunk/phase3/includes/api/ApiQueryDeletedrevs.php |
— | — | @@ -139,16 +139,20 @@ |
140 | 140 | $this->getDB()->addQuotes($params['excludeuser'])); |
141 | 141 | } |
142 | 142 | |
143 | | - if(!is_null($params['continue']) && $mode == 'all') |
| 143 | + if(!is_null($params['continue']) && ($mode == 'all' || $mode == 'revs')) |
144 | 144 | { |
145 | 145 | $cont = explode('|', $params['continue']); |
146 | | - if(count($cont) != 2) |
| 146 | + if(count($cont) != 3) |
147 | 147 | $this->dieUsage("Invalid continue param. You should pass the original value returned by the previous query", "badcontinue"); |
148 | | - $title = $this->getDB()->strencode($this->titleToKey($cont[0])); |
149 | | - $ts = $this->getDB()->strencode($cont[1]); |
150 | | - $this->addWhere("ar_title > '$title' OR " . |
| 148 | + $ns = intval($cont[0]); |
| 149 | + $title = $this->getDB()->strencode($this->titleToKey($cont[1])); |
| 150 | + $ts = $this->getDB()->strencode($cont[2]); |
| 151 | + $op = ($params['dir'] == 'newer' ? '>' : '<'); |
| 152 | + $this->addWhere("ar_namespace $op $ns OR " . |
| 153 | + "(ar_namespace = $ns AND " . |
| 154 | + "(ar_title $op '$title' OR " . |
151 | 155 | "(ar_title = '$title' AND " . |
152 | | - "ar_timestamp >= '$ts')"); |
| 156 | + "ar_timestamp = '$ts')))"); |
153 | 157 | } |
154 | 158 | |
155 | 159 | $this->addOption('LIMIT', $limit + 1); |
— | — | @@ -182,9 +186,9 @@ |
183 | 187 | if(++$count > $limit) |
184 | 188 | { |
185 | 189 | // We've had enough |
186 | | - if($mode == 'all') |
187 | | - $this->setContinueEnumParameter('continue', $this->keyToTitle($row->ar_title) . '|' . |
188 | | - $row->ar_timestamp); |
| 190 | + if($mode == 'all' || $mode == 'revs') |
| 191 | + $this->setContinueEnumParameter('continue', intval($row->ar_namespace) . '|' . |
| 192 | + $this->keyToTitle($row->ar_title) . '|' . $row->ar_timestamp); |
189 | 193 | else |
190 | 194 | $this->setContinueEnumParameter('start', wfTimestamp(TS_ISO_8601, $row->ar_timestamp)); |
191 | 195 | break; |
— | — | @@ -227,9 +231,9 @@ |
228 | 232 | } |
229 | 233 | if(!$fit) |
230 | 234 | { |
231 | | - if($mode == 'all') |
232 | | - $this->setContinueEnumParameter('continue', $this->keyToTitle($row->ar_title) . '|' . |
233 | | - $row->ar_timestamp); |
| 235 | + if($mode == 'all' || $mode == 'revs') |
| 236 | + $this->setContinueEnumParameter('continue', intval($row->ar_namespace) . '|' . |
| 237 | + $this->keyToTitle($row->ar_title) . '|' . $row->ar_timestamp); |
234 | 238 | else |
235 | 239 | $this->setContinueEnumParameter('start', wfTimestamp(TS_ISO_8601, $row->ar_timestamp)); |
236 | 240 | break; |