Index: trunk/phase3/includes/SpecialAllpages.php |
— | — | @@ -88,15 +88,14 @@ |
89 | 89 | global $wgOut, $indexMaxperpage, $toplevelMaxperpage, $wgContLang, $wgRequest, $wgUser; |
90 | 90 | $sk = $wgUser->getSkin(); |
91 | 91 | $fname = "indexShowToplevel"; |
92 | | - $namespace = intval ($namespace); |
93 | 92 | |
94 | 93 | # TODO: Either make this *much* faster or cache the title index points |
95 | 94 | # in the querycache table. |
96 | 95 | |
97 | 96 | $dbr =& wfGetDB( DB_SLAVE ); |
98 | 97 | $page = $dbr->tableName( 'page' ); |
99 | | - $invsql = ($invert) ? '!' : ''; |
100 | | - $fromwhere = "FROM $page WHERE page_namespace$invsql=$namespace"; |
| 98 | + $fromwhere = "FROM $page WHERE page_namespace" . |
| 99 | + ($invert ? '!' : '') . "=$namespace"; |
101 | 100 | $order_arr = array ( 'ORDER BY' => 'page_title' ); |
102 | 101 | $order_str = 'ORDER BY page_title'; |
103 | 102 | $out = ""; |
— | — | @@ -199,7 +198,7 @@ |
200 | 199 | |
201 | 200 | $inpointf = htmlspecialchars( str_replace( '_', ' ', $inpoint ) ); |
202 | 201 | $outpointf = htmlspecialchars( str_replace( '_', ' ', $outpoint ) ); |
203 | | - $queryparams = ($namespace ? ('namespace='.intval($namespace)) : '') . ($invert ? "&invert=$invert" : ''); |
| 202 | + $queryparams = ($namespace ? "namespace=$namespace" : '') . ($invert ? "&invert=$invert" : ''); |
204 | 203 | $special = Title::makeTitle( NS_SPECIAL, 'Allpages/' . $inpoint ); |
205 | 204 | $link = $special->escapeLocalUrl( $queryparams ); |
206 | 205 | |
— | — | @@ -220,7 +219,6 @@ |
221 | 220 | global $wgOut, $wgUser, $indexMaxperpage, $wgContLang; |
222 | 221 | $sk = $wgUser->getSkin(); |
223 | 222 | $maxPlusOne = $indexMaxperpage + 1; |
224 | | - $namespacee = intval($namespace); |
225 | 223 | |
226 | 224 | $out = ''; |
227 | 225 | $dbr =& wfGetDB( DB_SLAVE ); |
— | — | @@ -229,8 +227,8 @@ |
230 | 228 | $fromTitle = Title::newFromURL( $from ); |
231 | 229 | $fromKey = is_null( $fromTitle ) ? '' : $fromTitle->getDBkey(); |
232 | 230 | |
233 | | - $invsql = ($invert) ? '!' : ''; |
234 | | - $sql = "SELECT page_title FROM $page WHERE page_namespace$invsql=$namespacee" . |
| 231 | + $sql = "SELECT page_namespace, page_title FROM $page WHERE page_namespace" . |
| 232 | + ($invert ? '!' : '') . "=$namespace" . |
235 | 233 | " AND page_title >= ". $dbr->addQuotes( $fromKey ) . |
236 | 234 | " ORDER BY page_title LIMIT " . $maxPlusOne; |
237 | 235 | $res = $dbr->query( $sql, 'indexShowChunk' ); |
— | — | @@ -240,7 +238,7 @@ |
241 | 239 | $n = 0; |
242 | 240 | $out = '<table style="background: inherit;" border="0" width="100%">'; |
243 | 241 | while( ($n < $indexMaxperpage) && ($s = $dbr->fetchObject( $res )) ) { |
244 | | - $t = Title::makeTitle( $namespacee, $s->page_title ); |
| 242 | + $t = Title::makeTitle( $s->page_namespace, $s->page_title ); |
245 | 243 | if( $t ) { |
246 | 244 | $link = $sk->makeKnownLinkObj( $t, $t->getText() ); |
247 | 245 | } else { |