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
This commit is contained in:
parent
2ad3973067
commit
4bfe8ff81f
1 changed files with 2 additions and 7 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue