Index: branches/REL1_18/phase3/includes/HTMLForm.php |
— | — | @@ -1570,8 +1570,7 @@ |
1571 | 1571 | /** |
1572 | 1572 | * Double field with a dropdown list constructed from a system message in the format |
1573 | 1573 | * * Optgroup header |
1574 | | - * ** <option value>|<option name> |
1575 | | - * ** <option value == option name> |
| 1574 | + * ** <option value> |
1576 | 1575 | * * New Optgroup header |
1577 | 1576 | * Plus a text field underneath for an additional reason. The 'value' of the field is |
1578 | 1577 | * ""<select>: <extra reason>"", or "<extra reason>" if nothing has been selected in the |
— | — | @@ -1583,7 +1582,7 @@ |
1584 | 1583 | function __construct( $params ) { |
1585 | 1584 | if ( array_key_exists( 'other', $params ) ) { |
1586 | 1585 | } elseif( array_key_exists( 'other-message', $params ) ){ |
1587 | | - $params['other'] = wfMessage( $params['other-message'] )->escaped(); |
| 1586 | + $params['other'] = wfMessage( $params['other-message'] )->plain(); |
1588 | 1587 | } else { |
1589 | 1588 | $params['other'] = null; |
1590 | 1589 | } |
— | — | @@ -1593,7 +1592,7 @@ |
1594 | 1593 | } elseif( array_key_exists( 'options-message', $params ) ){ |
1595 | 1594 | # Generate options array from a system message |
1596 | 1595 | $params['options'] = self::parseMessage( |
1597 | | - wfMessage( $params['options-message'] )->inContentLanguage()->escaped(), |
| 1596 | + wfMessage( $params['options-message'] )->inContentLanguage()->plain(), |
1598 | 1597 | $params['other'] |
1599 | 1598 | ); |
1600 | 1599 | } else { |
— | — | @@ -1614,7 +1613,7 @@ |
1615 | 1614 | */ |
1616 | 1615 | public static function parseMessage( $string, $otherName=null ) { |
1617 | 1616 | if( $otherName === null ){ |
1618 | | - $otherName = wfMessage( 'htmlform-selectorother-other' )->escaped(); |
| 1617 | + $otherName = wfMessage( 'htmlform-selectorother-other' )->plain(); |
1619 | 1618 | } |
1620 | 1619 | |
1621 | 1620 | $optgroup = false; |
— | — | @@ -1631,23 +1630,15 @@ |
1632 | 1631 | } elseif ( substr( $value, 0, 2) == '**' ) { |
1633 | 1632 | # groupmember |
1634 | 1633 | $opt = trim( substr( $value, 2 ) ); |
1635 | | - $parts = array_map( 'trim', explode( '|', $opt, 2 ) ); |
1636 | | - if( count( $parts ) === 1 ){ |
1637 | | - $parts[1] = $parts[0]; |
1638 | | - } |
1639 | 1634 | if( $optgroup === false ){ |
1640 | | - $options[$parts[1]] = $parts[0]; |
| 1635 | + $options[$opt] = $opt; |
1641 | 1636 | } else { |
1642 | | - $options[$optgroup][$parts[1]] = $parts[0]; |
| 1637 | + $options[$optgroup][$opt] = $opt; |
1643 | 1638 | } |
1644 | 1639 | } else { |
1645 | 1640 | # groupless reason list |
1646 | 1641 | $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; |
1652 | 1643 | } |
1653 | 1644 | } |
1654 | 1645 | |