X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FXml.php;h=40be80bc5beae1c8223e48829fe8b2e6d0edb167;hb=2e1b3f94ad3620c87d8f5587576628a56556054e;hp=7dcd4a4327590016ef99d9dc459715d128c0792d;hpb=577f3d79115173f4dd16bb46f6d0ef2c82b55add;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Xml.php b/includes/Xml.php index 7dcd4a4327..40be80bc5b 100644 --- a/includes/Xml.php +++ b/includes/Xml.php @@ -49,7 +49,7 @@ class Xml { if ( $allowShortTag && $contents === '' ) { $out .= ' />'; } else { - $out .= '>' . htmlspecialchars( $contents ) . ""; + $out .= '>' . htmlspecialchars( $contents, ENT_NOQUOTES ) . ""; } } 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 . ""; } @@ -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 @@ -382,7 +382,7 @@ class Xml { $value = false, $attribs = [] ) { list( $label, $input ) = self::inputLabelSep( $label, $name, $id, $size, $value, $attribs ); - return $label . ' ' . $input; + return $label . "\u{00A0}" . $input; } /** @@ -420,7 +420,7 @@ class Xml { public static function checkLabel( $label, $name, $id, $checked = false, $attribs = [] ) { global $wgUseMediaWikiUIEverywhere; $chkLabel = self::check( $name, $checked, [ 'id' => $id ] + $attribs ) . - ' ' . + "\u{00A0}" . self::label( $label, $id, $attribs ); if ( $wgUseMediaWikiUIEverywhere ) { @@ -446,7 +446,7 @@ class Xml { $checked = false, $attribs = [] ) { return self::radio( $name, $value, $checked, [ 'id' => $id ] + $attribs ) . - ' ' . + "\u{00A0}" . self::label( $label, $id, $attribs ); }