Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -2574,7 +2574,7 @@ |
2575 | 2575 | // We're on a preview of a JS subpage |
2576 | 2576 | // Exclude this page from the user module in case it's in there (bug 26283) |
2577 | 2577 | $scripts .= $this->makeResourceLoaderLink( 'user', ResourceLoaderModule::TYPE_SCRIPTS, false, |
2578 | | - array( 'excludepage' => $this->getTitle()->getPrefixedText() ) |
| 2578 | + array( 'excludepage' => $this->getTitle()->getPrefixedDBkey() ) |
2579 | 2579 | ); |
2580 | 2580 | // Load the previewed JS |
2581 | 2581 | $scripts .= Html::inlineScript( "\n" . $this->getRequest()->getText( 'wpTextbox1' ) . "\n" ) . "\n"; |
— | — | @@ -2979,10 +2979,10 @@ |
2980 | 2980 | // We're on a preview of a CSS subpage |
2981 | 2981 | // Exclude this page from the user module in case it's in there (bug 26283) |
2982 | 2982 | $otherTags .= $this->makeResourceLoaderLink( 'user', ResourceLoaderModule::TYPE_STYLES, false, |
2983 | | - array( 'excludepage' => $this->getTitle()->getPrefixedText() ) |
| 2983 | + array( 'excludepage' => $this->getTitle()->getPrefixedDBkey() ) |
2984 | 2984 | ); |
2985 | 2985 | // Load the previewed CSS |
2986 | | - $otherTags .= Html::inlineStyle( $this->getRequest()->getText( 'wpTextbox1' ) );; |
| 2986 | + $otherTags .= Html::inlineStyle( $this->getRequest()->getText( 'wpTextbox1' ) ); |
2987 | 2987 | } else { |
2988 | 2988 | // Load the user styles normally |
2989 | 2989 | $moduleStyles[] = 'user'; |
Index: trunk/phase3/includes/resourceloader/ResourceLoaderUserModule.php |
— | — | @@ -34,13 +34,17 @@ |
35 | 35 | */ |
36 | 36 | protected function getPages( ResourceLoaderContext $context ) { |
37 | 37 | if ( $context->getUser() ) { |
| 38 | + // Get the normalized title of the user's user page |
38 | 39 | $username = $context->getUser(); |
| 40 | + $userpageTitle = Title::makeTitleSafe( NS_USER, $username ); |
| 41 | + $userpage = $userpageTitle->getPrefixedDBkey(); // Needed so $excludepages works |
| 42 | + |
39 | 43 | $pages = array( |
40 | | - "User:$username/common.js" => array( 'type' => 'script' ), |
41 | | - "User:$username/" . $context->getSkin() . '.js' => |
| 44 | + "$userpage/common.js" => array( 'type' => 'script' ), |
| 45 | + "$userpage/" . $context->getSkin() . '.js' => |
42 | 46 | array( 'type' => 'script' ), |
43 | | - "User:$username/common.css" => array( 'type' => 'style' ), |
44 | | - "User:$username/" . $context->getSkin() . '.css' => |
| 47 | + "$userpage/common.css" => array( 'type' => 'style' ), |
| 48 | + "$userpage/" . $context->getSkin() . '.css' => |
45 | 49 | array( 'type' => 'style' ), |
46 | 50 | ); |
47 | 51 | |
— | — | @@ -49,6 +53,8 @@ |
50 | 54 | // parameter will be set to the name of the page we need to exclude. |
51 | 55 | $excludepage = $context->getRequest()->getVal( 'excludepage' ); |
52 | 56 | if ( isset( $pages[$excludepage] ) ) { |
| 57 | + // This works because $excludepage is generated with getPrefixedDBkey(), |
| 58 | + // just like the keys in $pages[] above |
53 | 59 | unset( $pages[$excludepage] ); |
54 | 60 | } |
55 | 61 | return $pages; |