X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FXml.php;h=e124c38b75521b3551fc36dcd10831a7cc8844be;hb=b8bf745ca957de92f447ded545179663d344191f;hp=43f72177a9b3372a9c34b59c76de5506a280a752;hpb=b5906606e1aa1a795231fb813b766818b1dd6c25;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Xml.php b/includes/Xml.php index 43f72177a9..e124c38b75 100644 --- a/includes/Xml.php +++ b/includes/Xml.php @@ -238,7 +238,6 @@ class Xml { Xml::label( $msg->text(), $attrs['id'] ), Xml::tags( 'select', $attrs, $options ) ]; - } /** @@ -452,7 +451,7 @@ class Xml { /** * Convenience function to build an HTML submit button - * When $wgUseMediaWikiUIEverywhere is true it will default to a constructive button + * When $wgUseMediaWikiUIEverywhere is true it will default to a progressive button * @param string $value Label text for the button * @param array $attribs Optional custom attributes * @return string HTML @@ -467,7 +466,7 @@ class Xml { // some submit forms // might need to be mw-ui-destructive (e.g. delete a page) if ( $wgUseMediaWikiUIEverywhere ) { - $baseAttrs['class'] = 'mw-ui-button mw-ui-constructive'; + $baseAttrs['class'] = 'mw-ui-button mw-ui-progressive'; } // Any custom attributes will take precendence of anything in baseAttrs e.g. override the class $attribs = $attribs + $baseAttrs; @@ -614,42 +613,6 @@ class Xml { $content, false ); } - /** - * Returns an escaped string suitable for inclusion in a string literal - * for JavaScript source code. - * Illegal control characters are assumed not to be present. - * - * @deprecated since 1.21; use Xml::encodeJsVar() or Xml::encodeJsCall() instead - * @param string $string String to escape - * @return string - */ - public static function escapeJsString( $string ) { - // See ECMA 262 section 7.8.4 for string literal format - $pairs = [ - "\\" => "\\\\", - "\"" => "\\\"", - '\'' => '\\\'', - "\n" => "\\n", - "\r" => "\\r", - - # To avoid closing the element or CDATA section - "<" => "\\x3c", - ">" => "\\x3e", - - # To avoid any complaints about bad entity refs - "&" => "\\x26", - - # Work around https://bugzilla.mozilla.org/show_bug.cgi?id=274152 - # Encode certain Unicode formatting chars so affected - # versions of Gecko don't misinterpret our strings; - # this is a common problem with Farsi text. - "\xe2\x80\x8c" => "\\u200c", // ZERO WIDTH NON-JOINER - "\xe2\x80\x8d" => "\\u200d", // ZERO WIDTH JOINER - ]; - - return strtr( $string, $pairs ); - } - /** * Encode a variable of arbitrary type to JavaScript. * If the value is an XmlJsCode object, pass through the object's value verbatim.