From c95fe9ae2f377d0ff235262d38c524d7c6fba068 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Tue, 26 Jun 2007 01:01:08 +0000 Subject: [PATCH] * 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-user-css, mw-user-js, mw-site-css, mw-site-js) *
 Merge RELEASE-NOTES regarding the addition of a feature and a change to that
 feature

---
 RELEASE-NOTES        |  9 +++++----
 includes/Article.php | 17 ++++++++++++-----
 2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index 18eca4670c..b519f22cbd 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -75,14 +75,13 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   a path to the AdminSettings.php file
 * (bug 8781) Remind users to check file permissions for LocalSettings.php
   post-installation
-* (bug 10196) Add classes and dir="ltr" to the 
s on user CSS and JS pages
-  (new classes: mw-user-css, mw-user-js)
 * Use shared.css for all skins and oldshared.css in place of common.css for
   pre-Monobook skins.  As always, modifications should go in-wiki to MediaWiki:
   Common.css and MediaWiki:Monobook.css.
 * (bug 8869) Introduce Special:Uncategorizedtemplates
 * (bug 8734) Different log message when article protection level is changed
-* (bug 8458) Limit custom signature length to $wgMaxSigChars bytes
+* (bug 8458, 10338) Limit custom signature length to $wgMaxSigChars Unicode
+  characters
 * (bug 10096) Added an ability to query interwiki map table
 * On reupload, add a null revision to the image description page
 * Group log output by date
@@ -101,9 +100,11 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   enabled by default.
 * Added option to install to MyISAM
 * (bug 9250) Remove hardcoded minimum image name length of three characters
-* (bug 10338) Enforce signature length limit in Unicode characters instead of bytes
 * 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-user-css, mw-user-js, mw-site-css, mw-site-js)
 
 == Bugfixes since 1.10 ==
 
diff --git a/includes/Article.php b/includes/Article.php
index 7925189e62..b4aa97f371 100644
--- a/includes/Article.php
+++ b/includes/Article.php
@@ -777,14 +777,21 @@ class Article {
 		}
 		if( !$outputDone ) {
 			$wgOut->setRevisionId( $this->getRevIdFetched() );
-			# wrap user css and user js in pre and don't parse
-			# XXX: use $this->mTitle->usCssJsSubpage() when php is fixed/ a workaround is found
+			// Wrap site/user css/js in pre and don't parse.  User pages need
+			// to be subpages, site pages just need to end in ".css" or ".js".
+
+			// @todo: use $this->mTitle->isCssJsSubpage() when php is fixed/
+			// a workaround is found.
 			if (
-				$ns == NS_USER &&
-				preg_match('!/[\w]+\.(css|js)$!', $this->mTitle->getDBkey(), $matches)
+				($ns == NS_USER and preg_match('#/\w+\.(css|js)$#',$this->mTitle->getDBkey(),$matches))
+				or ($ns == NS_MEDIAWIKI and preg_match('/.(css|js)$/', $this->mTitle->getDBkey(), $matches))
 			) {
 				$wgOut->addWikiText( wfMsg('clearyourcache'));
-				$wgOut->addHTML( "
".htmlspecialchars($this->mContent)."\n
" ); + $classbit = $ns == NS_USER ? 'user' : 'site'; + $wgOut->addHTML( + "
"
+					.htmlspecialchars($this->mContent)."\n
" + ); } else if ( $rt = Title::newFromRedirect( $text ) ) { # Display redirect $imageDir = $wgContLang->isRTL() ? 'rtl' : 'ltr'; -- 2.20.1