Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3440
patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
bzimport
Nov 21 2014, 9:29 PM
2014-11-21 21:29:36 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
patch
View Options
Index: includes/Title.php
===================================================================
--- includes/Title.php (revision 18293)
+++ includes/Title.php (working copy)
@@ -1089,8 +1089,7 @@
# protect css/js subpages of user pages
# XXX: this might be better using restrictions
# XXX: Find a way to work around the php bug that prevents using $this->userCanEditCssJsSubpage() from working
- if( NS_USER == $this->mNamespace
- && preg_match("/\\.(css|js)$/", $this->mTextform )
+ if( $this->isCssJsSubpage()
&& !$wgUser->isAllowed('editinterface')
&& !preg_match('/^'.preg_quote($wgUser->getName(), '/').'\//', $this->mTextform) ) {
wfProfileOut( $fname );
@@ -1223,7 +1222,7 @@
* @access public
*/
function isCssJsSubpage() {
- return ( NS_USER == $this->mNamespace and preg_match("/\\.(css|js)$/", $this->mTextform ) );
+ return ( NS_USER == $this->mNamespace and preg_match("/\\/.*\\.(css|js)$/", $this->mTextform ) );
}
/**
* Is this a *valid* .css or .js subpage of a user page?
@@ -1251,7 +1250,7 @@
* @access public
*/
function isCssSubpage() {
- return ( NS_USER == $this->mNamespace and preg_match("/\\.css$/", $this->mTextform ) );
+ return ( NS_USER == $this->mNamespace and preg_match("/\\/.*\\.css$/", $this->mTextform ) );
}
/**
* Is this a .js subpage of a user page?
@@ -1259,7 +1258,7 @@
* @access public
*/
function isJsSubpage() {
- return ( NS_USER == $this->mNamespace and preg_match("/\\.js$/", $this->mTextform ) );
+ return ( NS_USER == $this->mNamespace and preg_match("/\\/.*\\.js$/", $this->mTextform ) );
}
/**
* Protect css/js subpages of user pages: can $wgUser edit
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3008
Default Alt Text
patch (1 KB)
Attached To
Mode
T10241: User:Foo.css and User:Foo.js considered user CSS/JS subpages
Attached
Detach File
Event Timeline
Log In to Comment