http://www.mediawiki.org/wiki/Special:Code/MediaWiki/97862

Revision: 97862
Author:   brion
Date:     2011-09-22 22:16:14 +0000 (Thu, 22 Sep 2011)
Log Message:
-----------
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: branches/wmf/1.18wmf1/includes/HTMLForm.php
===================================================================
--- branches/wmf/1.18wmf1/includes/HTMLForm.php 2011-09-22 22:15:52 UTC (rev 
97861)
+++ branches/wmf/1.18wmf1/includes/HTMLForm.php 2011-09-22 22:16:14 UTC (rev 
97862)
@@ -1570,8 +1570,7 @@
 /**
  * Double field with a dropdown list constructed from a system message in the 
format
  *     * Optgroup header
- *     ** <option value>|<option name>
- *     ** <option value == option name>
+ *     ** <option value>
  *     * New Optgroup header
  * Plus a text field underneath for an additional reason.  The 'value' of the 
field is
  * ""<select>: <extra reason>"", or "<extra reason>" if nothing has been 
selected in the
@@ -1583,7 +1582,7 @@
        function __construct( $params ) {
                if ( array_key_exists( 'other', $params ) ) {
                } elseif( array_key_exists( 'other-message', $params ) ){
-                       $params['other'] = wfMessage( $params['other-message'] 
)->escaped();
+                       $params['other'] = wfMessage( $params['other-message'] 
)->plain();
                } else {
                        $params['other'] = null;
                }
@@ -1593,7 +1592,7 @@
                } elseif( array_key_exists( 'options-message', $params ) ){
                        # Generate options array from a system message
                        $params['options'] = self::parseMessage(
-                               wfMessage( $params['options-message'] 
)->inContentLanguage()->escaped(),
+                               wfMessage( $params['options-message'] 
)->inContentLanguage()->plain(),
                                $params['other']
                        );
                } else {
@@ -1614,7 +1613,7 @@
         */
        public static function parseMessage( $string, $otherName=null ) {
                if( $otherName === null ){
-                       $otherName = wfMessage( 'htmlform-selectorother-other' 
)->escaped();
+                       $otherName = wfMessage( 'htmlform-selectorother-other' 
)->plain();
                }
 
                $optgroup = false;
@@ -1631,23 +1630,15 @@
                        } elseif ( substr( $value, 0, 2) == '**' ) {
                                # groupmember
                                $opt = trim( substr( $value, 2 ) );
-                               $parts = array_map( 'trim', explode( '|', $opt, 
2 ) );
-                               if( count( $parts ) === 1 ){
-                                       $parts[1] = $parts[0];
-                               }
                                if( $optgroup === false ){
-                                       $options[$parts[1]] = $parts[0];
+                                       $options[$opt] = $opt;
                                } else {
-                                       $options[$optgroup][$parts[1]] = 
$parts[0];
+                                       $options[$optgroup][$opt] = $opt;
                                }
                        } else {
                                # groupless reason list
                                $optgroup = false;
-                               $parts = array_map( 'trim', explode( '|', 
$option, 2 ) );
-                               if( count( $parts ) === 1 ){
-                                       $parts[1] = $parts[0];
-                               }
-                               $options[$parts[1]] = $parts[0];
+                               $options[$option] = $option;
                        }
                }
 


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to