Merge "Make ChangeTag use NameTableStore for change_tag_def table"
[lhc/web/wiklou.git] / includes / Xml.php
index 7dcd4a4..af38740 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;
@@ -124,11 +124,11 @@ class Xml {
         * content you have is already valid xml.
         *
         * @param string $element Element name
-        * @param array $attribs Array of attributes
+        * @param array|null $attribs Array of attributes
         * @param string $contents Content of the element
         * @return string
         */
-       public static function tags( $element, $attribs = null, $contents ) {
+       public static function tags( $element, $attribs, $contents ) {
                return self::openElement( $element, $attribs ) . $contents . "</$element>";
        }
 
@@ -214,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