Index: branches/REL1_15/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; |
Index: branches/REL1_15/phase3/includes/api/ApiEditPage.php |
— | — | @@ -58,6 +58,9 @@ |
59 | 59 | $titleObj = Title::newFromText($params['title']); |
60 | 60 | if(!$titleObj) |
61 | 61 | $this->dieUsageMsg(array('invalidtitle', $params['title'])); |
| 62 | + // Some functions depend on $wgTitle == $ep->mTitle |
| 63 | + global $wgTitle; |
| 64 | + $wgTitle = $titleObj; |
62 | 65 | |
63 | 66 | if($params['createonly'] && $titleObj->exists()) |
64 | 67 | $this->dieUsageMsg(array('createonly-exists')); |
— | — | @@ -197,10 +200,6 @@ |
198 | 201 | # Do the actual save |
199 | 202 | $oldRevId = $articleObj->getRevIdFetched(); |
200 | 203 | $result = null; |
201 | | - # *Something* is setting $wgTitle to a title corresponding to "Msg", |
202 | | - # but that breaks API mode detection through is_null($wgTitle) |
203 | | - global $wgTitle; |
204 | | - $wgTitle = null; |
205 | 204 | # Fake $wgRequest for some hooks inside EditPage |
206 | 205 | # FIXME: This interface SUCKS |
207 | 206 | $oldRequest = $wgRequest; |
Property changes on: branches/REL1_15/phase3/includes/api |
___________________________________________________________________ |
Name: svn:mergeinfo |
208 | 207 | - /trunk/phase3/includes/api:48813-48814,48819,48836,48886,48892,48909,48989,48992,49002,49051,49068,49086,49191-49192,49212,49682,49685,49730,49775,49954,49956,50041,50070,50169 |
209 | 208 | + /trunk/phase3/includes/api:48813-48814,48819,48836,48886,48892,48909,48989,48992,49002,49051,49068,49086,49191-49192,49212,49682,49685,49730,49775,49954,49956,49999,50041,50070,50132,50134,50169,50218 |
Property changes on: branches/REL1_15/phase3/includes/specials |
___________________________________________________________________ |
Name: svn:mergeinfo |
210 | 209 | - /trunk/phase3/includes/specials:48836,48886,48892,48989,48992-48993,49002,49051,49068,49086,49191-49192,49212,49682,49685,49730,49775,49954,49956,50041,50070,50169 |
/trunk/phase3/includes/specials/specials:48993 |
211 | 210 | + /trunk/phase3/includes/specials:48836,48886,48892,48989,48992-48993,49002,49051,49068,49086,49191-49192,49212,49682,49685,49730,49775,49954,49956,49999,50041,50070,50132,50134,50169,50218 |
/trunk/phase3/includes/specials/specials:48993 |
Property changes on: branches/REL1_15/phase3/includes |
___________________________________________________________________ |
Name: svn:mergeinfo |
212 | 211 | - /trunk/phase3/includes:48836,48886,48892,48989,48992,49002,49051,49068,49086,49191-49192,49212,49682,49685,49730,49775,49954,49956,50041,50070,50169 |
/trunk/phase3/includes/specials:48993 |
213 | 212 | + /trunk/phase3/includes:48836,48886,48892,48989,48992,49002,49051,49068,49086,49191-49192,49212,49682,49685,49730,49775,49954,49956,49999,50041,50070,50132,50134,50169,50218 |
/trunk/phase3/includes/specials:48993 |
Index: branches/REL1_15/phase3/api.php |
— | — | @@ -69,6 +69,13 @@ |
70 | 70 | die(1); |
71 | 71 | } |
72 | 72 | |
| 73 | +// So extensions can check whether they're running in API mode |
| 74 | +define('MW_API', true); |
| 75 | + |
| 76 | +// Set a dummy $wgTitle, because $wgTitle == null breaks various things |
| 77 | +// In a perfect world this wouldn't be necessary |
| 78 | +$wgTitle = Title::newFromText('API'); |
| 79 | + |
73 | 80 | /* Construct an ApiMain with the arguments passed via the URL. What we get back |
74 | 81 | * is some form of an ApiMain, possibly even one that produces an error message, |
75 | 82 | * but we don't care here, as that is handled by the ctor. |
Property changes on: branches/REL1_15/phase3 |
___________________________________________________________________ |
Name: svn:mergeinfo |
76 | 83 | - /trunk/phase3:48814,48836,48886,48892,48909,48989,48992,49002,49051,49068,49086,49191-49192,49212,49682,49685,49730,49775,49954,49956,50041,50070,50169 |
77 | 84 | + /trunk/phase3:48814,48836,48886,48892,48909,48989,48992,49002,49051,49068,49086,49191-49192,49212,49682,49685,49730,49775,49954,49956,49999,50041,50070,50132,50134,50169,50218 |