r92300 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92299‎ | r92300 | r92301 >
Date:20:30, 15 July 2011
Author:brion
Status:ok (Comments)
Tags:
Comment:
Revert r84874: breaks ProofreadPage's UI completely by incorrectly comparing namespace numbers against namespace names
Modified paths:
  • /trunk/extensions/ProofreadPage/ProofreadPage_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ProofreadPage/ProofreadPage_body.php
@@ -311,22 +311,23 @@
312312 }
313313 $out->proofreadPageDone = true;
314314
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;
 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;
328319 }
329 - return true;
330320
 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+
331332 return true;
332333 }
333334

Follow-up revisions

RevisionCommit summaryAuthorDate
r92322MFT r92300 - revert r84874 accidental breakage in ProofreadPagebrion22:05, 15 July 2011
r92324REL_1.18 MFT r89121, r89266, r90723, r90857, r91578, r92300reedy22:08, 15 July 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r84874Clean up extra needless preg_match() calls done on every BeforePageDisplay ca...demon19:07, 27 March 2011

Comments

#Comment by Brion VIBBER (talk | contribs)   20:32, 15 July 2011

Regression fix for ProofreadPage from prior to 1.18 branch needs merging.

#Comment by Brion VIBBER (talk | contribs)   22:14, 15 July 2011

done on r92324

#Comment by 😂 (talk | contribs)   20:33, 15 July 2011

Right, but there's still gotta be a nicer way than regexp on every pageview :)

Status & tagging log