Index: trunk/phase3/includes/Wiki.php |
— | — | @@ -42,6 +42,7 @@ |
43 | 43 | /** |
44 | 44 | * Initialization of ... everything |
45 | 45 | * Performs the request too |
| 46 | + * FIXME: why is this crap called "initialize" when it performs everything? |
46 | 47 | * |
47 | 48 | * @param $title Title ($wgTitle) |
48 | 49 | * @param $article Article |
— | — | @@ -85,7 +86,6 @@ |
86 | 87 | } |
87 | 88 | } |
88 | 89 | |
89 | | - |
90 | 90 | /** |
91 | 91 | * Checks some initial queries |
92 | 92 | * Note that $title here is *not* a Title object, but a string! |
— | — | @@ -157,6 +157,8 @@ |
158 | 158 | * - redirect loop |
159 | 159 | * - special pages |
160 | 160 | * |
| 161 | + * FIXME: why is this crap called "initialize" when it performs everything? |
| 162 | + * |
161 | 163 | * @param $title Title |
162 | 164 | * @param $output OutputPage |
163 | 165 | * @param $request WebRequest |
— | — | @@ -286,9 +288,14 @@ |
287 | 289 | function initializeArticle( &$title, $request ) { |
288 | 290 | wfProfileIn( __METHOD__ ); |
289 | 291 | |
290 | | - $action = $this->getVal( 'action' ); |
| 292 | + $action = $this->getVal( 'action', 'view' ); |
291 | 293 | $article = self::articleFromTitle( $title ); |
292 | | - |
| 294 | + # NS_MEDIAWIKI has no redirects. |
| 295 | + # It is also used for CSS/JS, so performance matters here... |
| 296 | + if( $title->getNamespace() == NS_MEDIAWIKI ) { |
| 297 | + wfProfileOut( __METHOD__ ); |
| 298 | + return $article; |
| 299 | + } |
293 | 300 | // Namespace might change when using redirects |
294 | 301 | // Check for redirects ... |
295 | 302 | $file = ($title->getNamespace() == NS_FILE) ? $article->getFile() : null; |
— | — | @@ -317,8 +324,7 @@ |
318 | 325 | return $target; |
319 | 326 | } |
320 | 327 | } |
321 | | - |
322 | | - if( is_object( $target ) ) { |
| 328 | + if( is_object($target) ) { |
323 | 329 | // Rewrite environment to redirected article |
324 | 330 | $rarticle = self::articleFromTitle( $target ); |
325 | 331 | $rarticle->loadPageData( $rarticle->pageDataFromTitle( $dbr, $target ) ); |