r97862 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97861‎ | r97862 | r97863 >
Date:22:16, 22 September 2011
Author:brion
Status:ok
Tags:
Comment:
MFT r97860: fix regression bug 31089 (broke ipbreason-dropdown entries on Special:Block that contain piped links, as on mediawiki.org)
Modified paths:
  • /branches/wmf/1.18wmf1/includes/HTMLForm.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/includes/HTMLForm.php
@@ -1570,8 +1570,7 @@
15711571 /**
15721572 * Double field with a dropdown list constructed from a system message in the format
15731573 * * Optgroup header
1574 - * ** <option value>|<option name>
1575 - * ** <option value == option name>
 1574+ * ** <option value>
15761575 * * New Optgroup header
15771576 * Plus a text field underneath for an additional reason. The 'value' of the field is
15781577 * ""<select>: <extra reason>"", or "<extra reason>" if nothing has been selected in the
@@ -1583,7 +1582,7 @@
15841583 function __construct( $params ) {
15851584 if ( array_key_exists( 'other', $params ) ) {
15861585 } elseif( array_key_exists( 'other-message', $params ) ){
1587 - $params['other'] = wfMessage( $params['other-message'] )->escaped();
 1586+ $params['other'] = wfMessage( $params['other-message'] )->plain();
15881587 } else {
15891588 $params['other'] = null;
15901589 }
@@ -1593,7 +1592,7 @@
15941593 } elseif( array_key_exists( 'options-message', $params ) ){
15951594 # Generate options array from a system message
15961595 $params['options'] = self::parseMessage(
1597 - wfMessage( $params['options-message'] )->inContentLanguage()->escaped(),
 1596+ wfMessage( $params['options-message'] )->inContentLanguage()->plain(),
15981597 $params['other']
15991598 );
16001599 } else {
@@ -1614,7 +1613,7 @@
16151614 */
16161615 public static function parseMessage( $string, $otherName=null ) {
16171616 if( $otherName === null ){
1618 - $otherName = wfMessage( 'htmlform-selectorother-other' )->escaped();
 1617+ $otherName = wfMessage( 'htmlform-selectorother-other' )->plain();
16191618 }
16201619
16211620 $optgroup = false;
@@ -1631,23 +1630,15 @@
16321631 } elseif ( substr( $value, 0, 2) == '**' ) {
16331632 # groupmember
16341633 $opt = trim( substr( $value, 2 ) );
1635 - $parts = array_map( 'trim', explode( '|', $opt, 2 ) );
1636 - if( count( $parts ) === 1 ){
1637 - $parts[1] = $parts[0];
1638 - }
16391634 if( $optgroup === false ){
1640 - $options[$parts[1]] = $parts[0];
 1635+ $options[$opt] = $opt;
16411636 } else {
1642 - $options[$optgroup][$parts[1]] = $parts[0];
 1637+ $options[$optgroup][$opt] = $opt;
16431638 }
16441639 } else {
16451640 # groupless reason list
16461641 $optgroup = false;
1647 - $parts = array_map( 'trim', explode( '|', $option, 2 ) );
1648 - if( count( $parts ) === 1 ){
1649 - $parts[1] = $parts[0];
1650 - }
1651 - $options[$parts[1]] = $parts[0];
 1642+ $options[$option] = $option;
16521643 }
16531644 }
16541645

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r97860* (bug 31089) Fix regression in Special:Block reasons list (MediaWiki:Ipbreas...brion22:10, 22 September 2011
r97861MFT r97860: fix regression bug 31089 (broke ipbreason-dropdown entries on Spe...brion22:15, 22 September 2011

Status & tagging log