SECURITY: Fix CORS origin matching in the API
[lhc/web/wiklou.git] / includes / Setup.php
index c6c94b7..535b13d 100644 (file)
@@ -77,9 +77,12 @@ if ( $wgStyleDirectory === false ) {
 if ( $wgExtensionAssetsPath === false ) {
        $wgExtensionAssetsPath = "$wgScriptPath/extensions";
 }
+if ( $wgResourceBasePath === null ) {
+       $wgResourceBasePath = $wgScriptPath;
+}
 
 if ( $wgLogo === false ) {
-       $wgLogo = "$wgStylePath/common/images/wiki.png";
+       $wgLogo = "$wgResourceBasePath/resources/assets/wiki.png";
 }
 
 if ( $wgUploadPath === false ) {
@@ -106,7 +109,7 @@ if ( $wgGitInfoCacheDirectory === false && $wgCacheDirectory !== false ) {
 if ( $wgRightsIcon ) {
        $wgRightsIcon = str_replace(
                "{$wgStylePath}/common/images/",
-               "{$wgScriptPath}/assets/licenses/",
+               "{$wgResourceBasePath}/resources/assets/licenses/",
                $wgRightsIcon
        );
 }
@@ -133,7 +136,7 @@ if ( isset( $wgFooterIcons['poweredby'] )
        && $wgFooterIcons['poweredby']['mediawiki']['src'] === null
 ) {
        $wgFooterIcons['poweredby']['mediawiki']['src'] =
-               "$wgScriptPath/assets/poweredby_mediawiki_88x31.png";
+               "$wgResourceBasePath/resources/assets/poweredby_mediawiki_88x31.png";
 }
 
 /**
@@ -303,6 +306,11 @@ if ( $wgSharedPrefix === false ) {
        $wgSharedPrefix = $wgDBprefix;
 }
 
+// Set default shared schema
+if ( $wgSharedSchema === false ) {
+       $wgSharedSchema = $wgDBmwschema;
+}
+
 if ( !$wgCookiePrefix ) {
        if ( $wgSharedDB && $wgSharedPrefix && in_array( 'user', $wgSharedTables ) ) {
                $wgCookiePrefix = $wgSharedDB . '_' . $wgSharedPrefix;
@@ -514,6 +522,10 @@ if ( $wgTmpDirectory === false ) {
        wfProfileOut( $fname . '-tempDir' );
 }
 
+// We don't use counters anymore. Left here for extensions still
+// expecting this to exist. Should be removed sometime 1.26 or later.
+$wgDisableCounters = true;
+
 wfProfileOut( $fname . '-defaults2' );
 wfProfileIn( $fname . '-misc1' );
 
@@ -572,7 +584,7 @@ wfDebugLog( 'caches', 'main: ' . get_class( $wgMemc ) .
 wfProfileOut( $fname . '-memcached' );
 
 // Most of the config is out, some might want to run hooks here.
-wfRunHooks( 'SetupAfterCache' );
+Hooks::run( 'SetupAfterCache' );
 
 wfProfileIn( $fname . '-session' );
 
@@ -622,7 +634,7 @@ $wgParser = new StubObject( 'wgParser', $wgParserConf['class'], array( $wgParser
 
 if ( !is_object( $wgAuth ) ) {
        $wgAuth = new AuthPlugin;
-       wfRunHooks( 'AuthPluginSetup', array( &$wgAuth ) );
+       Hooks::run( 'AuthPluginSetup', array( &$wgAuth ) );
 }
 
 /**