r46151 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46150‎ | r46151 | r46152 >
Date:17:42, 24 January 2009
Author:ialex
Status:ok
Tags:
Comment:
* Removed false comment, we are in a Category page, not an Image page
* Use wfMsgExt( 'msg', array( 'escape' ), ... ) rather than htmlspecialchars( wfMsg( ... ) )
* Whitespaces tweaks
Modified paths:
  • /trunk/phase3/includes/CategoryPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/CategoryPage.php
@@ -20,7 +20,8 @@
2121 if ( isset( $diff ) && $diffOnly )
2222 return Article::view();
2323
24 - if(!wfRunHooks('CategoryPageView', array(&$this))) return;
 24+ if( !wfRunHooks( 'CategoryPageView', array( &$this ) ) )
 25+ return;
2526
2627 if ( NS_CATEGORY == $this->mTitle->getNamespace() ) {
2728 $this->openShowCategory();
@@ -28,10 +29,6 @@
2930
3031 Article::view();
3132
32 - # If the article we've just shown is in the "Image" namespace,
33 - # follow it with the history list and link list for the image
34 - # it describes.
35 -
3633 if ( NS_CATEGORY == $this->mTitle->getNamespace() ) {
3734 $this->closeShowCategory();
3835 }
@@ -79,7 +76,7 @@
8077 $this->from = $from;
8178 $this->until = $until;
8279 $this->limit = $wgCategoryPagingLimit;
83 - $this->cat = Category::newFromName( $title->getDBKey() );
 80+ $this->cat = Category::newFromTitle( $title );
8481 }
8582
8683 /**
@@ -317,7 +314,7 @@
318315 $countmsg = $this->getCountMessage( $rescnt, $dbcnt, 'file' );
319316
320317 return "<div id=\"mw-category-media\">\n" .
321 - '<h2>' . wfMsg( 'category-media-header', htmlspecialchars($this->title->getText()) ) . "</h2>\n" .
 318+ '<h2>' . wfMsg( 'category-media-header', htmlspecialchars( $this->title->getText() ) ) . "</h2>\n" .
322319 $countmsg . $this->gallery->toHTML() . "\n</div>";
323320 } else {
324321 return '';
@@ -452,12 +449,12 @@
453450 $sk = $this->getSkin();
454451 $limitText = $wgLang->formatNum( $limit );
455452
456 - $prevLink = htmlspecialchars( wfMsg( 'prevn', $limitText ) );
 453+ $prevLink = wfMsgExt( 'prevn', array( 'escape' ), $limitText );
457454 if( $first != '' ) {
458455 $prevLink = $sk->makeLinkObj( $title, $prevLink,
459456 wfArrayToCGI( $query + array( 'until' => $first ) ) );
460457 }
461 - $nextLink = htmlspecialchars( wfMsg( 'nextn', $limitText ) );
 458+ $nextLink = wfMsgExt( 'nextn', array( 'escape' ), $limitText );
462459 if( $last != '' ) {
463460 $nextLink = $sk->makeLinkObj( $title, $nextLink,
464461 wfArrayToCGI( $query + array( 'from' => $last ) ) );

Status & tagging log