Merge "Fix PreferencesForm alias"
[lhc/web/wiklou.git] / includes / Xml.php
index 0091513..4f2720e 100644 (file)
@@ -49,7 +49,7 @@ class Xml {
                        if ( $allowShortTag && $contents === '' ) {
                                $out .= ' />';
                        } else {
-                               $out .= '>' . htmlspecialchars( $contents ) . "</$element>";
+                               $out .= '>' . htmlspecialchars( $contents, ENT_NOQUOTES ) . "</$element>";
                        }
                }
                return $out;
@@ -160,8 +160,9 @@ class Xml {
        }
 
        /**
-        * @param int $year
-        * @param int $month
+        * @param int|string $year Use '' or 0 to start with no year preselected.
+        * @param int|string $month A month in the 1..12 range. Use '', 0 or -1 to start with no month
+        *  preselected.
         * @return string Formatted HTML
         */
        public static function dateMenu( $year, $month ) {
@@ -213,10 +214,10 @@ class Xml {
                // a custom language code might not have a defined name...
                if ( !array_key_exists( $wgLanguageCode, $languages ) ) {
                        $languages[$wgLanguageCode] = $wgLanguageCode;
+                       // Sort the array again
+                       ksort( $languages );
                }
 
-               ksort( $languages );
-
                /**
                 * If a bogus value is set, default to the content language.
                 * Otherwise, no default is selected and the user ends up
@@ -532,8 +533,8 @@ class Xml {
         *
         * @param string $list Correctly formatted text (newline delimited) to be
         *   used to generate the options.
-        * @param array $params Extra parameters
-        * @param string $params['other'] If set, add an option with this as text and a value of 'other'
+        * @param array $params Extra parameters:
+        *   - string $params['other'] If set, add an option with this as text and a value of 'other'
         * @return array Array keys are textual labels, values are internal values
         */
        public static function listDropDownOptions( $list, $params = [] ) {