From 4bfe8ff81f027ad11ab8277c94648c92310b3233 Mon Sep 17 00:00:00 2001 From: Ori Livneh Date: Sat, 12 Apr 2014 01:16:42 -0700 Subject: [PATCH] Use ResourceLoader::makeComment to embed page title in wiki modules It's a bit odd to simply decline to entitle wiki page modules that have '*/' in their title when the title could simply be escaped. Change-Id: I4456ae683cdae4a5a5e4a4a731046cadf1d8ee4d --- includes/resourceloader/ResourceLoaderWikiModule.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/includes/resourceloader/ResourceLoaderWikiModule.php b/includes/resourceloader/ResourceLoaderWikiModule.php index 2653f76497..f275a6bbf1 100644 --- a/includes/resourceloader/ResourceLoaderWikiModule.php +++ b/includes/resourceloader/ResourceLoaderWikiModule.php @@ -125,10 +125,7 @@ abstract class ResourceLoaderWikiModule extends ResourceLoaderModule { $script = $this->getContent( $title ); if ( strval( $script ) !== '' ) { $script = $this->validateScriptFile( $titleText, $script ); - if ( strpos( $titleText, '*/' ) === false ) { - $scripts .= "/* $titleText */\n"; - } - $scripts .= $script . "\n"; + $scripts .= ResourceLoader::makeComment( $titleText ) . $script . "\n"; } } return $scripts; @@ -162,9 +159,7 @@ abstract class ResourceLoaderWikiModule extends ResourceLoaderModule { if ( !isset( $styles[$media] ) ) { $styles[$media] = array(); } - if ( strpos( $titleText, '*/' ) === false ) { - $style = "/* $titleText */\n" . $style; - } + $style = ResourceLoader::makeComment( $titleText ) . $style; $styles[$media][] = $style; } return $styles; -- 2.20.1