| Index: trunk/phase3/includes/resourceloader/ResourceLoaderStartUpModule.php |
| — | — | @@ -55,14 +55,21 @@ |
| 56 | 56 | ); |
| 57 | 57 | $mainPage = Title::newMainPage(); |
| 58 | 58 | |
| 59 | | - // Build wgNamespaceIds |
| 60 | | - // A complete key-value pair object mapping localized, canonical and aliases for namespaces |
| 61 | | - // to their numerical ids (case insensitive and with underscores) |
| | 59 | + /** |
| | 60 | + * Namespace related preparation |
| | 61 | + * - wgNamespaceIds: Key-value pairs of all localized, canonical and aliases for namespaces. |
| | 62 | + * - wgCaseSensitiveNamespaces: Array of namespaces that are case-sensitive. |
| | 63 | + */ |
| 62 | 64 | $namespaceIds = $wgContLang->getNamespaceIds(); |
| | 65 | + $caseSensitiveNamespaces = array(); |
| 63 | 66 | foreach( MWNamespace::getCanonicalNamespaces() as $index => $name ) { |
| 64 | 67 | $namespaceIds[$wgContLang->lc( $name )] = $index; |
| | 68 | + if ( !MWNamespace::isCapitalized( $index ) ) { |
| | 69 | + $caseSensitiveNamespaces[] = $index; |
| | 70 | + } |
| 65 | 71 | } |
| 66 | 72 | |
| | 73 | + |
| 67 | 74 | $serverBits = wfParseUrl( $wgServer ); |
| 68 | 75 | $protocol = $serverBits ? $serverBits['scheme'] : 'http'; |
| 69 | 76 | |
| — | — | @@ -106,6 +113,7 @@ |
| 107 | 114 | 'wgCookiePrefix' => $wgCookiePrefix, |
| 108 | 115 | 'wgResourceLoaderMaxQueryLength' => $wgResourceLoaderMaxQueryLength, |
| 109 | 116 | 'wgLegacyJavaScriptGlobals' => $wgLegacyJavaScriptGlobals, |
| | 117 | + 'wgCaseSensitiveNamespaces' => $caseSensitiveNamespaces, |
| 110 | 118 | ); |
| 111 | 119 | if ( $wgUseAjax && $wgEnableMWSuggest ) { |
| 112 | 120 | $vars['wgMWSuggestTemplate'] = SearchEngine::getMWSuggestTemplate(); |
| — | — | @@ -263,4 +271,4 @@ |
| 264 | 272 | public function getGroup() { |
| 265 | 273 | return 'startup'; |
| 266 | 274 | } |
| 267 | | -} |
| \ No newline at end of file |
| | 275 | +} |