r62528 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62527‎ | r62528 | r62529 >
Date:17:12, 15 February 2010
Author:dale
Status:ok (Comments)
Tags:
Comment:
follow-up to r62526 ( also support enableparser for cases where you don't want to replace any argument )
Modified paths:
  • /branches/js2-work/phase3/includes/api/ApiQueryAllmessages.php (modified) (history)

Diff [purge]

Index: branches/js2-work/phase3/includes/api/ApiQueryAllmessages.php
@@ -81,17 +81,20 @@
8282 $skip = false;
8383 if(!$skip) {
8484 $a = array( 'name' => $message );
 85+ $args = null;
8586 if( isset( $params['args'] ) && count( $params['args'] ) != 0 ){
86 - // Check if the parser is enabled:
87 - if( $params[ 'enableparser' ] ){
88 - $msg = wfMsgExt( $message, array( 'parsemag' ), $params['args'] );
89 - } else {
90 - $msgString = wfMsgGetKey( $message, true, false, false );
91 - $msg = wfMsgReplaceArgs( $msgString, $params['args'] );
92 - }
 87+ $args = $params['args'];
 88+ }
 89+ // Check if the parser is enabled:
 90+ if( $params[ 'enableparser' ] ){
 91+ $msg = wfMsgExt( $message, array( 'parsemag' ), $args );
 92+ } else if ( $args ) {
 93+ $msgString = wfMsgGetKey( $message, true, false, false );
 94+ $msg = wfMsgReplaceArgs( $msgString, $params['args'] );
9395 }else{
9496 $msg = wfMsgGetKey( $message, true, false, false );
9597 }
 98+
9699 if ( wfEmptyMsg( $message, $msg ) )
97100 $a['missing'] = '';
98101 else {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r62526First round of fixes to AjaxLogin:\...demon16:47, 15 February 2010

Comments

#Comment by Catrope (talk | contribs)   17:34, 15 February 2010
+				} else if ( $args ) {
+					$msg = wfMsgReplaceArgs( $msgString, $params['args'] );

Just use $args on the latter line, since it's equal to $params['args'] anyway and matches the if clause better.

#Comment by Mdale (talk | contribs)   17:50, 15 February 2010

oky r62530

Status & tagging log