r90895 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90894‎ | r90895 | r90896 >
Date:18:05, 27 June 2011
Author:happy-melon
Status:ok
Tags:
Comment:
(bug 29511) block dropdown reasons should be in wiki content language.
Modified paths:
  • /trunk/phase3/includes/HTMLForm.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/HTMLForm.php
@@ -1568,16 +1568,19 @@
15691569 function __construct( $params ) {
15701570 if ( array_key_exists( 'other', $params ) ) {
15711571 } elseif( array_key_exists( 'other-message', $params ) ){
1572 - $params['other'] = wfMsg( $params['other-message'] );
 1572+ $params['other'] = wfMessage( $params['other-message'] )->escaped();
15731573 } else {
1574 - $params['other'] = wfMsg( 'htmlform-selectorother-other' );
 1574+ $params['other'] = null;
15751575 }
15761576
15771577 if ( array_key_exists( 'options', $params ) ) {
15781578 # Options array already specified
15791579 } elseif( array_key_exists( 'options-message', $params ) ){
15801580 # Generate options array from a system message
1581 - $params['options'] = self::parseMessage( wfMsg( $params['options-message'], $params['other'] ) );
 1581+ $params['options'] = self::parseMessage(
 1582+ wfMessage( $params['options-message'] )->inContentLanguage()->escaped(),
 1583+ $params['other']
 1584+ );
15821585 } else {
15831586 # Sulk
15841587 throw new MWException( 'HTMLSelectAndOtherField called without any options' );
@@ -1596,7 +1599,7 @@
15971600 */
15981601 public static function parseMessage( $string, $otherName=null ) {
15991602 if( $otherName === null ){
1600 - $otherName = wfMsg( 'htmlform-selectorother-other' );
 1603+ $otherName = wfMessage( 'htmlform-selectorother-other' )->escaped();
16011604 }
16021605
16031606 $optgroup = false;

Status & tagging log