From 7fc6a7aae05f9d501df3b1ad06e7d151434adab0 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Mon, 5 Dec 2011 10:14:40 +0000 Subject: [PATCH] Skip replaceInternalLinks2 for js/css pages Just skip the whole replaceInternalLinks2 parser function whenever we hit js/css pages. Previous patch r103476 only handled Category links which was not enough. --- includes/parser/Parser.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 3c41eb3d4a..881133b721 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -1643,6 +1643,12 @@ class Parser { * @private */ function replaceInternalLinks( $s ) { + if( $this->getTitle()->isCssOrJsPage() ) { + # bug 32450 : js and script pages in MediaWiki: namespace do not want + # to get their code or comments altered. Think about js string: + # var foobar = "[[Category:" + $catname + "]]; + return $s; + } $this->mLinkHolders->merge( $this->replaceInternalLinks2( $s ) ); return $s; } @@ -1913,14 +1919,6 @@ class Parser { if ( $ns == NS_CATEGORY ) { wfProfileIn( __METHOD__."-category" ); - if( $this->getTitle()->isCssOrJsPage() ) { - # bug 32450 : js and script pages in MediaWiki: namespace do not want - # to get their code or comments altered. Think about js string: - # var foobar = "[[Category:" + $catname + "]]; - $s .= "[[$text]]$trail"; - wfProfileOut( __METHOD__."-category" ); - continue; - } $s = rtrim( $s . "\n" ); # bug 87 if ( $wasblank ) { -- 2.20.1