Index: trunk/phase3/includes/SpecialAllpages.php |
— | — | @@ -211,21 +211,27 @@ |
212 | 212 | */ |
213 | 213 | function indexShowChunk( $namespace = NS_MAIN, $from, $including = false ) { |
214 | 214 | global $wgOut, $wgUser, $indexMaxperpage, $wgContLang; |
| 215 | + |
| 216 | + $fname = 'indexShowChunk'; |
| 217 | + |
215 | 218 | $sk = $wgUser->getSkin(); |
216 | | - $maxPlusOne = $indexMaxperpage + 1; |
217 | 219 | |
218 | | - $out = ''; |
219 | | - $dbr =& wfGetDB( DB_SLAVE ); |
220 | | - $page = $dbr->tableName( 'page' ); |
221 | | - |
222 | 220 | $fromTitle = Title::newFromURL( $from ); |
223 | 221 | $fromKey = is_null( $fromTitle ) ? '' : $fromTitle->getDBkey(); |
224 | 222 | |
225 | | - $sql = "SELECT page_namespace,page_title FROM $page" . |
226 | | - " WHERE page_namespace=$namespace" . |
227 | | - " AND page_title >= ". $dbr->addQuotes( $fromKey ) . |
228 | | - " ORDER BY page_title LIMIT " . $maxPlusOne; |
229 | | - $res = $dbr->query( $sql, 'indexShowChunk' ); |
| 223 | + $dbr =& wfGetDB( DB_SLAVE ); |
| 224 | + $res = $dbr->select( 'page', |
| 225 | + array( 'page_namespace', 'page_title' ), |
| 226 | + array( |
| 227 | + 'page_namespace' => $namespace, |
| 228 | + 'page_title >= ' . $dbr->addQuotes( $fromKey ) |
| 229 | + ), |
| 230 | + $fname, |
| 231 | + array( |
| 232 | + 'ORDER BY' => 'page_title', |
| 233 | + 'LIMIT' => $indexMaxperpage + 1 |
| 234 | + ) |
| 235 | + ); |
230 | 236 | |
231 | 237 | ### FIXME: side link to previous |
232 | 238 | |