From 5f392f7f484a7c107d09ef451246bcabaee6cc7f Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Sun, 1 Jul 2007 19:57:30 +0000 Subject: [PATCH] * (bug 10422) Change
 on CSS/JS pages to 
and allow wikitext * Remove now-unused ShowRawCssJs hook, unless someone can think of a reason someone would want to use it when wikitext is allowed inside it Patch to SyntaxHighlight_GeSHi to come in a moment. --- RELEASE-NOTES | 13 +++++++------ docs/hooks.txt | 7 +------ includes/Article.php | 15 ++++++--------- 3 files changed, 14 insertions(+), 21 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 1185fbba28..577b7a80c9 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -104,17 +104,18 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 9250) Remove hardcoded minimum image name length of three characters * Fixed DISPLAYTITLE behaviour to reject titles which don't normalise to the same title as the current page, and enabled per default -* Wrap site CSS and JavaScript in a
 tag, like user JS/CSS
-* (bug 10196) Add classes and dir="ltr" to the 
s on CSS and JS pages (new
-  classes: mw-code, mw-css, mw-js)
+* (bug 10196) Add classes and dir="ltr" to 
s wrapping CSS and JS pages + (new classes: mw-code, mw-css, mw-js) * (bug 6711) Add $wgAddGroups and $wgRemoveGroups to allow finer control over usergroup assignment. * Introduce 'UserEffectiveGroups' hook; see docs/hooks.txt for more information * (bug 10387) Detect and handle '.php5' extension environments at install time Patch by Edward Z. Yang. -* Introduce 'ShowRawCssJs' hook; see docs/hooks.txt for more information -* (bug 10404) Show rights log fragment for the selected user in Special:Userrights -* New javascript for upload page that will show a warning if a file with the "destination filename" already exists. +* (bug 10404) Show rights log for the selected user in Special:Userrights +* New javascript for upload page that will show a warning if a file with the + "destination filename" already exists. +* (bug 10422) Do not wrap user JS/CSS in
; allow it to render as wikitext.
+  like site CSS/JS.
 
 == Bugfixes since 1.10 ==
 
diff --git a/docs/hooks.txt b/docs/hooks.txt
index a74591a8f6..6f188e931a 100644
--- a/docs/hooks.txt
+++ b/docs/hooks.txt
@@ -656,14 +656,9 @@ $content_actions: The array of content actions
 		     Can be used to set custom CSS/JS
 $out: OutputPage object
 
-'ShowRawCssJs': Customise the output of raw CSS and JavaScript in page views
-$text: Text being shown
-$title: Title of the custom script/stylesheet page
-$output: Current OutputPage object
-
 'AjaxAddScript': Called in output page just before the initialisation
 of the javascript ajax engine. The hook is only called when ajax
 is enabled ( $wgUseAjax = true; ).
 
 More hooks might be available but undocumented, you can execute
-./maintenance/findhooks.php to find hidden one.
\ No newline at end of file
+./maintenance/findhooks.php to find hidden one.
diff --git a/includes/Article.php b/includes/Article.php
index 9f3795e749..58de866a81 100644
--- a/includes/Article.php
+++ b/includes/Article.php
@@ -784,15 +784,12 @@ class Article {
 			if( $this->mTitle->isCssOrJsPage() || $this->mTitle->isCssJsSubpage() ) {
 				$wgOut->addHtml( wfMsgExt( 'clearyourcache', 'parse' ) );
 
-				// Give hooks a chance to customise the output
-				if( wfRunHooks( 'ShowRawCssJs', array( $this->mContent, $this->mTitle, $wgOut ) ) ) {
-					// Wrap the whole lot in a 
 and don't parse
-					preg_match( '!\.(css|js)$!u', $this->mTitle->getText(), $m );
-					$wgOut->addHtml( "
\n" );
-					$wgOut->addHtml( htmlspecialchars( $this->mContent ) );
-					$wgOut->addHtml( "\n
\n" ); - } - + // Add classes, give directionality. Do parse it as wikitext + // (bug 10422). + preg_match( '!\.(css|js)$!u', $this->mTitle->getText(), $m ); + $wgOut->addHtml( "
\n" ); + $wgOut->addWikiText( $this->mContent ); + $wgOut->addHtml( "\n
\n" ); } elseif ( $rt = Title::newFromRedirect( $text ) ) { -- 2.20.1