Index: trunk/extensions/ProofreadPage/ProofreadPage_body.php |
— | — | @@ -311,23 +311,22 @@ |
312 | 312 | } |
313 | 313 | $out->proofreadPageDone = true; |
314 | 314 | |
315 | | - $page_namespace = $this->page_namespace; |
316 | | - if ( preg_match( "/^$page_namespace:(.*?)(\/([0-9]*)|)$/", $wgTitle->getPrefixedText(), $m ) ) { |
317 | | - $this->preparePage( $out, $m, $isEdit ); |
318 | | - return true; |
| 315 | + switch( $wgTitle->getNamespace() ) { |
| 316 | + case $this->page_namespace: |
| 317 | + if ( preg_match( "/^{$this->page_namespace}:(.*?)(\/([0-9]*)|)$/", $wgTitle->getPrefixedText(), $m ) ) { |
| 318 | + $this->preparePage( $out, $m, $isEdit ); |
| 319 | + return true; |
| 320 | + } |
| 321 | + break; |
| 322 | + case $this->index_namespace: |
| 323 | + $this->prepareIndex( $out ); |
| 324 | + break; |
| 325 | + case NS_MAIN: |
| 326 | + $this->prepareArticle( $out ); |
| 327 | + break; |
319 | 328 | } |
| 329 | + return true; |
320 | 330 | |
321 | | - $index_namespace = $this->index_namespace; |
322 | | - if ( $isEdit && ( preg_match( "/^$index_namespace:(.*?)(\/([0-9]*)|)$/", $wgTitle->getPrefixedText(), $m ) ) ) { |
323 | | - $this->prepareIndex( $out ); |
324 | | - return true; |
325 | | - } |
326 | | - |
327 | | - if( $wgTitle->getNamespace() == NS_MAIN ) { |
328 | | - $this->prepareArticle( $out ); |
329 | | - return true; |
330 | | - } |
331 | | - |
332 | 331 | return true; |
333 | 332 | } |
334 | 333 | |