From 42fa47fcd2977ea84117d91b33810842d08675ea Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Thu, 3 Jun 2004 02:23:17 +0000 Subject: [PATCH] protect global stylesheets to devs only --- includes/Title.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/Title.php b/includes/Title.php index 97f566ada9..19568ad9b5 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -492,6 +492,11 @@ class Title { if ( NS_MEDIAWIKI == $this->mNamespace && !$wgUser->isSysop() ) { return false; } # if ( 0 == $this->getArticleID() ) { return false; } if ( $this->mDbkeyform == "_" ) { return false; } + # protect global styles and js + if ( NS_MEDIAWIKI == $this->mNamespace + && !$wgUser->isDeveloper() + && preg_match("/\\.(css|js)$/", $this->mTextform )) + { return false; } //if ( $this->isCssJsSubpage() and !$this->userCanEditCssJsSubpage() ) { return false; } # protect css/js subpages of user pages # XXX: this might be better using restrictions -- 2.20.1