diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2013-12-08 09:55:49 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2013-12-08 09:55:49 +0100 |
commit | 4ac9fa081a7c045f6a9f1cfc529d82423f485b2e (patch) | |
tree | af68743f2f4a47d13f2b0eb05f5c4aaf86d8ea37 /includes/resourceloader/ResourceLoaderStartUpModule.php | |
parent | af4da56f1ad4d3ef7b06557bae365da2ea27a897 (diff) |
Update to MediaWiki 1.22.0
Diffstat (limited to 'includes/resourceloader/ResourceLoaderStartUpModule.php')
-rw-r--r-- | includes/resourceloader/ResourceLoaderStartUpModule.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/includes/resourceloader/ResourceLoaderStartUpModule.php b/includes/resourceloader/ResourceLoaderStartUpModule.php index 32cf6b26..20f6e0ba 100644 --- a/includes/resourceloader/ResourceLoaderStartUpModule.php +++ b/includes/resourceloader/ResourceLoaderStartUpModule.php @@ -27,6 +27,7 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule { /* Protected Members */ protected $modifiedTime = array(); + protected $targets = array( 'desktop', 'mobile' ); /* Protected Methods */ @@ -51,7 +52,7 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule { */ $namespaceIds = $wgContLang->getNamespaceIds(); $caseSensitiveNamespaces = array(); - foreach( MWNamespace::getCanonicalNamespaces() as $index => $name ) { + foreach ( MWNamespace::getCanonicalNamespaces() as $index => $name ) { $namespaceIds[$wgContLang->lc( $name )] = $index; if ( !MWNamespace::isCapitalized( $index ) ) { $caseSensitiveNamespaces[] = $index; @@ -83,7 +84,7 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule { 'wgFormattedNamespaces' => $wgContLang->getFormattedNamespaces(), 'wgNamespaceIds' => $namespaceIds, 'wgSiteName' => $wgSitename, - 'wgFileExtensions' => array_values( $wgFileExtensions ), + 'wgFileExtensions' => array_values( array_unique( $wgFileExtensions ) ), 'wgDBname' => $wgDBname, // This sucks, it is only needed on Special:Upload, but I could // not find a way to add vars only for a certain module @@ -94,6 +95,7 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule { 'wgCookiePrefix' => $wgCookiePrefix, 'wgResourceLoaderMaxQueryLength' => $wgResourceLoaderMaxQueryLength, 'wgCaseSensitiveNamespaces' => $caseSensitiveNamespaces, + 'wgLegalTitleChars' => Title::convertByteClassToUnicodeClass( Title::legalChars() ), ); wfRunHooks( 'ResourceLoaderGetConfigVars', array( &$vars ) ); @@ -184,7 +186,7 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule { * @return string */ public function getScript( ResourceLoaderContext $context ) { - global $IP, $wgLoadScript, $wgLegacyJavaScriptGlobals; + global $IP, $wgLegacyJavaScriptGlobals; $out = file_get_contents( "$IP/resources/startup.js" ); if ( $context->getOnly() === 'scripts' ) { @@ -224,7 +226,7 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule { "};\n"; // Conditional script injection - $scriptTag = Html::linkedScript( $wgLoadScript . '?' . wfArrayToCgi( $query ) ); + $scriptTag = Html::linkedScript( wfAppendQuery( wfScript( 'load' ), $query ) ); $out .= "if ( isCompatible() ) {\n" . "\t" . Xml::encodeJsCall( 'document.write', array( $scriptTag ) ) . "}\n" . |