X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fresourceloader%2FResourceLoaderStartUpModule.php;h=acc2503d902ad396afb348af9b7a1801dc1e1245;hb=c7b0bb2459a6b14590b252935eccc2edfccae13b;hp=b5d31efac70d64b9a5f7fd63c5531976853f43eb;hpb=ac0ab2c03a12756b0965f250c174e228348ec459;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/resourceloader/ResourceLoaderStartUpModule.php b/includes/resourceloader/ResourceLoaderStartUpModule.php index b5d31efac7..acc2503d90 100644 --- a/includes/resourceloader/ResourceLoaderStartUpModule.php +++ b/includes/resourceloader/ResourceLoaderStartUpModule.php @@ -75,7 +75,6 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule { } $illegalFileChars = $conf->get( 'IllegalFileChars' ); - $oldCommentSchema = $conf->get( 'CommentTableSchemaMigrationStage' ) === MIGRATION_OLD; // Build list of variables $skin = $context->getSkin(); @@ -108,14 +107,12 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule { 'wgSiteName' => $conf->get( 'Sitename' ), 'wgDBname' => $conf->get( 'DBname' ), 'wgExtraSignatureNamespaces' => $conf->get( 'ExtraSignatureNamespaces' ), - 'wgAvailableSkins' => Skin::getSkinNames(), 'wgExtensionAssetsPath' => $conf->get( 'ExtensionAssetsPath' ), // MediaWiki sets cookies to have this prefix by default 'wgCookiePrefix' => $conf->get( 'CookiePrefix' ), 'wgCookieDomain' => $conf->get( 'CookieDomain' ), 'wgCookiePath' => $conf->get( 'CookiePath' ), 'wgCookieExpiration' => $conf->get( 'CookieExpiration' ), - 'wgResourceLoaderMaxQueryLength' => $conf->get( 'ResourceLoaderMaxQueryLength' ), 'wgCaseSensitiveNamespaces' => $caseSensitiveNamespaces, 'wgLegalTitleChars' => Title::convertByteClassToUnicodeClass( Title::legalChars() ), 'wgIllegalFileChars' => Title::convertByteClassToUnicodeClass( $illegalFileChars ), @@ -123,8 +120,8 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule { 'wgResourceLoaderStorageEnabled' => $conf->get( 'ResourceLoaderStorageEnabled' ), 'wgForeignUploadTargets' => $conf->get( 'ForeignUploadTargets' ), 'wgEnableUploads' => $conf->get( 'EnableUploads' ), - 'wgCommentByteLimit' => $oldCommentSchema ? 255 : null, - 'wgCommentCodePointLimit' => $oldCommentSchema ? null : CommentStore::COMMENT_CHARACTER_LIMIT, + 'wgCommentByteLimit' => null, + 'wgCommentCodePointLimit' => CommentStore::COMMENT_CHARACTER_LIMIT, ]; Hooks::run( 'ResourceLoaderGetConfigVars', [ &$vars, $skin ] ); @@ -388,6 +385,8 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule { */ public function getScript( ResourceLoaderContext $context ) { global $IP; + $conf = $this->getConfig(); + if ( $context->getOnly() !== 'scripts' ) { return '/* Requires only=script */'; } @@ -401,13 +400,16 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule { if ( $context->getDebug() ) { $mwLoaderCode .= file_get_contents( "$IP/resources/src/startup/mediawiki.log.js" ); } - if ( $this->getConfig()->get( 'ResourceLoaderEnableJSProfiler' ) ) { + if ( $conf->get( 'ResourceLoaderEnableJSProfiler' ) ) { $mwLoaderCode .= file_get_contents( "$IP/resources/src/startup/profiler.js" ); } // Perform replacements for mediawiki.js $mwLoaderPairs = [ '$VARS.baseModules' => ResourceLoader::encodeJsonForScript( $this->getBaseModules() ), + '$VARS.maxQueryLength' => ResourceLoader::encodeJsonForScript( + $conf->get( 'ResourceLoaderMaxQueryLength' ) + ), ]; $profilerStubs = [ '$CODE.profileExecuteStart();' => 'mw.loader.profiler.onExecuteStart( module );', @@ -415,7 +417,7 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule { '$CODE.profileScriptStart();' => 'mw.loader.profiler.onScriptStart( module );', '$CODE.profileScriptEnd();' => 'mw.loader.profiler.onScriptEnd( module );', ]; - if ( $this->getConfig()->get( 'ResourceLoaderEnableJSProfiler' ) ) { + if ( $conf->get( 'ResourceLoaderEnableJSProfiler' ) ) { // When profiling is enabled, insert the calls. $mwLoaderPairs += $profilerStubs; } else { @@ -427,7 +429,7 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule { // Perform string replacements for startup.js $pairs = [ '$VARS.wgLegacyJavaScriptGlobals' => ResourceLoader::encodeJsonForScript( - $this->getConfig()->get( 'LegacyJavaScriptGlobals' ) + $conf->get( 'LegacyJavaScriptGlobals' ) ), '$VARS.configuration' => ResourceLoader::encodeJsonForScript( $this->getConfigSettings( $context )