r83788 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83787‎ | r83788 | r83789 >
Date:22:40, 12 March 2011
Author:bawolff
Status:ok
Tags:
Comment:
Make this extension use $wgContLang, not $wgLang, since its a parser hook,
so the result gets stored in the parserCache, so it shouldn't vary by user language.

Change the wfMsg -> wfMsgForContent for same reason.
Modified paths:
  • /trunk/extensions/intersection/DynamicPageList.php (modified) (history)

Diff [purge]

Index: trunk/extensions/intersection/DynamicPageList.php
@@ -74,7 +74,7 @@
7575
7676 // The callback function for converting the input text to HTML output
7777 function renderDynamicPageList( $input ) {
78 - global $wgUser, $wgLang, $wgContLang;
 78+ global $wgUser, $wgContLang;
7979 global $wgDisableCounters; // to determine if to allow sorting by #hits.
8080 global $wgDLPmaxCategories, $wgDLPMaxResultCount;
8181 global $wgDLPAllowUnlimitedResults, $wgDLPAllowUnlimitedCategories;
@@ -393,7 +393,7 @@
394394
395395 if ( $catCount < 1 && false == $namespaceFiltering ) {
396396 if ( $suppressErrors == false ) {
397 - return htmlspecialchars( wfMsg( 'intersection_noincludecats' ) ); // "!!no included categories!!";
 397+ return htmlspecialchars( wfMsgForContent( 'intersection_noincludecats' ) ); // "!!no included categories!!";
398398 } else {
399399 return '';
400400 }
@@ -401,7 +401,7 @@
402402
403403 if ( $totalCatCount > $wgDLPmaxCategories && !$wgDLPAllowUnlimitedCategories ) {
404404 if ( $suppressErrors == false ) {
405 - return htmlspecialchars( wfMsg( 'intersection_toomanycats' ) ); // "!!too many categories!!";
 405+ return htmlspecialchars( wfMsgForContent( 'intersection_toomanycats' ) ); // "!!too many categories!!";
406406 } else {
407407 return '';
408408 }
@@ -554,7 +554,7 @@
555555
556556 if ( $dbr->numRows( $res ) == 0 ) {
557557 if ( $suppressErrors == false ) {
558 - return htmlspecialchars( wfMsg( 'intersection_noresults' ) );
 558+ return htmlspecialchars( wfMsgForContent( 'intersection_noresults' ) );
559559 } else {
560560 return '';
561561 }
@@ -588,10 +588,10 @@
589589 }
590590 $categoryDate = $df->reformat( $dateFormat, $categoryDate, array( 'match-whole' ) );
591591 } else {
592 - $categoryDate = $wgLang->date( wfTimestamp( TS_MW, $row->cl_timestamp ) );
 592+ $categoryDate = $wgContLang->date( wfTimestamp( TS_MW, $row->cl_timestamp ) );
593593 }
594594 if ( !$useGallery ) {
595 - $categoryDate .= wfMsg( 'colon-separator' );
 595+ $categoryDate .= wfMsgForContent( 'colon-separator' );
596596 } else {
597597 $categoryDate .= ' ';
598598 }

Status & tagging log