r83462 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83461‎ | r83462 | r83463 >
Date:17:10, 7 March 2011
Author:hashar
Status:ok
Tags:
Comment:
Remove second parameters from wfEmptyMsg() calls

The second parameter was removed in r64178 and is now useless.
There is probably no need to backport this in 1.17.
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)
  • /trunk/phase3/includes/HTMLForm.php (modified) (history)
  • /trunk/phase3/includes/Skin.php (modified) (history)
  • /trunk/phase3/includes/User.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryTags.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialContributions.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialDeletedContributions.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialStatistics.php (modified) (history)
  • /trunk/phase3/skins/MonoBook.php (modified) (history)
  • /trunk/phase3/skins/Vector.php (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/Vector.php
@@ -278,7 +278,7 @@
279279 }
280280 ?>
281281 <div class="portal" id='<?php echo Sanitizer::escapeId( "p-$name" ) ?>'<?php echo $this->skin->tooltip( 'p-' . $name ) ?>>
282 - <h5<?php $this->html('userlangattributes') ?>><?php $out = wfMsg( $msg ); if ( wfEmptyMsg( $msg, $out ) ) echo htmlspecialchars( $msg ); else echo htmlspecialchars( $out ); ?></h5>
 282+ <h5<?php $this->html('userlangattributes') ?>><?php $out = wfMsg( $msg ); if ( wfEmptyMsg( $msg ) ) echo htmlspecialchars( $msg ); else echo htmlspecialchars( $out ); ?></h5>
283283 <div class="body">
284284 <?php
285285 if ( is_array( $content ) ): ?>
Index: trunk/phase3/skins/MonoBook.php
@@ -286,7 +286,7 @@
287287 echo ' ' . Html::openElement( 'div', $portletAttribs );
288288 ?>
289289
290 - <h5><?php $out = wfMsg( $bar ); if (wfEmptyMsg($bar, $out)) echo htmlspecialchars($bar); else echo htmlspecialchars($out); ?></h5>
 290+ <h5><?php $out = wfMsg( $bar ); if (wfEmptyMsg($bar)) echo htmlspecialchars($bar); else echo htmlspecialchars($out); ?></h5>
291291 <div class='pBody'>
292292 <?php if ( is_array( $cont ) ) { ?>
293293 <ul>
Index: trunk/phase3/includes/User.php
@@ -3518,7 +3518,7 @@
35193519 static function getRightDescription( $right ) {
35203520 $key = "right-$right";
35213521 $name = wfMsg( $key );
3522 - return $name == '' || wfEmptyMsg( $key, $name )
 3522+ return $name == '' || wfEmptyMsg( $key )
35233523 ? $right
35243524 : $name;
35253525 }
Index: trunk/phase3/includes/GlobalFunctions.php
@@ -628,7 +628,7 @@
629629 */
630630 function wfMsgWeirdKey( $key ) {
631631 $source = wfMsgGetKey( $key, false, true, false );
632 - if ( wfEmptyMsg( $key, $source ) ) {
 632+ if ( wfEmptyMsg( $key ) ) {
633633 return '';
634634 } else {
635635 return $source;
Index: trunk/phase3/includes/HTMLForm.php
@@ -920,7 +920,7 @@
921921 if ( isset( $this->mParams['help-message'] ) ) {
922922 $msg = $this->mParams['help-message'];
923923 $helptext = wfMsgExt( $msg, 'parseinline' );
924 - if ( wfEmptyMsg( $msg, $helptext ) ) {
 924+ if ( wfEmptyMsg( $msg ) ) {
925925 # Never mind
926926 $helptext = null;
927927 }
Index: trunk/phase3/includes/api/ApiQueryTags.php
@@ -116,7 +116,7 @@
117117
118118 if ( $this->fld_description ) {
119119 $msg = wfMsg( "tag-$tagName-description" );
120 - $msg = wfEmptyMsg( "tag-$tagName-description", $msg ) ? '' : $msg;
 120+ $msg = wfEmptyMsg( "tag-$tagName-description" ) ? '' : $msg;
121121 $tag['description'] = $msg;
122122 }
123123
Index: trunk/phase3/includes/specials/SpecialStatistics.php
@@ -198,13 +198,13 @@
199199 }
200200 $groupname = htmlspecialchars( $group );
201201 $msg = wfMsg( 'group-' . $groupname );
202 - if ( wfEmptyMsg( 'group-' . $groupname, $msg ) || $msg == '' ) {
 202+ if ( wfEmptyMsg( 'group-' . $groupname ) || $msg == '' ) {
203203 $groupnameLocalized = $groupname;
204204 } else {
205205 $groupnameLocalized = $msg;
206206 }
207207 $msg = wfMsgForContent( 'grouppage-' . $groupname );
208 - if ( wfEmptyMsg( 'grouppage-' . $groupname, $msg ) || $msg == '' ) {
 208+ if ( wfEmptyMsg( 'grouppage-' . $groupname ) || $msg == '' ) {
209209 $grouppageLocalized = MWNamespace::getCanonicalName( NS_PROJECT ) . ':' . $groupname;
210210 } else {
211211 $grouppageLocalized = $msg;
Index: trunk/phase3/includes/specials/SpecialContributions.php
@@ -225,7 +225,7 @@
226226 // languages that want to put the "for" bit right after $user but before
227227 // $links. If 'contribsub' is around, use it for reverse compatibility,
228228 // otherwise use 'contribsub2'.
229 - if( wfEmptyMsg( 'contribsub', wfMsg( 'contribsub' ) ) ) {
 229+ if( wfEmptyMsg( 'contribsub' ) ) {
230230 return wfMsgHtml( 'contribsub2', $user, $links );
231231 } else {
232232 return wfMsgHtml( 'contribsub', "$user ($links)" );
@@ -397,7 +397,7 @@
398398 Xml::submitButton( wfMsg( 'sp-contributions-submit' ) )
399399 ) . ' ';
400400 $explain = wfMsgExt( 'sp-contributions-explain', 'parseinline' );
401 - if( !wfEmptyMsg( 'sp-contributions-explain', $explain ) ) {
 401+ if( !wfEmptyMsg( 'sp-contributions-explain' ) ) {
402402 $f .= "<p id='mw-sp-contributions-explain'>{$explain}</p>";
403403 }
404404 $f .= Xml::closeElement('fieldset' ) .
Index: trunk/phase3/includes/specials/SpecialDeletedContributions.php
@@ -453,7 +453,7 @@
454454 // languages that want to put the "for" bit right after $user but before
455455 // $links. If 'contribsub' is around, use it for reverse compatibility,
456456 // otherwise use 'contribsub2'.
457 - if( wfEmptyMsg( 'contribsub', wfMsg( 'contribsub' ) ) ) {
 457+ if( wfEmptyMsg( 'contribsub' ) ) {
458458 return wfMsgHtml( 'contribsub2', $user, $links );
459459 } else {
460460 return wfMsgHtml( 'contribsub', "$user ($links)" );
Index: trunk/phase3/includes/Skin.php
@@ -1424,11 +1424,11 @@
14251425
14261426 $text = wfMsgExt( $line[1], 'parsemag' );
14271427
1428 - if ( wfEmptyMsg( $line[1], $text ) ) {
 1428+ if ( wfEmptyMsg( $line[1] ) ) {
14291429 $text = $line[1];
14301430 }
14311431
1432 - if ( wfEmptyMsg( $line[0], $link ) ) {
 1432+ if ( wfEmptyMsg( $line[0] ) ) {
14331433 $link = $line[0];
14341434 }
14351435

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r64178Make MessageCache::get() return false if the requested message does not exist...happy-melon20:21, 25 March 2010

Status & tagging log