X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fresourceloader%2FResourceLoaderEditToolbarModule.php;h=2a6af71502fd8c682d48d38d2f8e8a274e0063db;hb=956967415397d64f7c67259f190e8122a0b32506;hp=da729fdc679380e5c0d8075e389a5c73616fc831;hpb=e475700141c34360f7d287ba618be70e96fab70a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/resourceloader/ResourceLoaderEditToolbarModule.php b/includes/resourceloader/ResourceLoaderEditToolbarModule.php index da729fdc67..2a6af71502 100644 --- a/includes/resourceloader/ResourceLoaderEditToolbarModule.php +++ b/includes/resourceloader/ResourceLoaderEditToolbarModule.php @@ -1,6 +1,6 @@ '\\\\', '"' => '\\"' ) ); - $value = preg_replace_callback( '/[\x01-\x1f\x7f-\x9f]/', function ( $match ) { - return '\\' . base_convert( ord( $match[0] ), 10, 16 ) . ' '; - }, $value ); - return '"' . $value . '"'; - } - /** * Get language-specific LESS variables for this module. * + * @since 1.27 + * @param ResourceLoaderContext $context * @return array */ - private function getLessVars( ResourceLoaderContext $context ) { + protected function getLessVars( ResourceLoaderContext $context ) { + $vars = parent::getLessVars( $context ); $language = Language::factory( $context->getLanguage() ); - - // This is very conveniently formatted and we can pass it right through - $vars = $language->getImageFiles(); - - // less.php tries to be helpful and parse our variables as LESS source code - foreach ( $vars as $key => &$value ) { - $value = self::cssSerializeString( $value ); + foreach ( $language->getImageFiles() as $key => $value ) { + $vars[$key] = CSSMin::serializeStringValue( $value ); } - return $vars; } - - /** - * @return bool - */ - public function enableModuleContentVersion() { - return true; - } - - /** - * Get a LESS compiler instance for this module. - * - * Set our variables in it. - * - * @throws MWException - * @param ResourceLoaderContext $context - * @return Less_Parser - */ - protected function getLessCompiler( ResourceLoaderContext $context = null ) { - $parser = parent::getLessCompiler(); - $parser->ModifyVars( $this->getLessVars( $context ) ); - return $parser; - } }