X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fresourceloader%2FResourceLoader.php;h=717fb458040e1fef4a492113d8e81b185f8addb3;hb=c584722cc2e3d33edae58d46c2149063b3fc6d72;hp=f0b48d544f030ed3e473e42aa5f1552fef279c1f;hpb=24dc5218b18bfa065a101057523f39a9c046d046;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/resourceloader/ResourceLoader.php b/includes/resourceloader/ResourceLoader.php index f0b48d544f..717fb45804 100644 --- a/includes/resourceloader/ResourceLoader.php +++ b/includes/resourceloader/ResourceLoader.php @@ -255,7 +255,10 @@ class ResourceLoader implements LoggerAwareInterface { $this->register( include "$IP/resources/ResourcesOOUI.php" ); // Register extension modules $this->register( $config->get( 'ResourceModules' ) ); - Hooks::run( 'ResourceLoaderRegisterModules', [ &$this ] ); + + // Avoid PHP 7.1 warning from passing $this by reference + $rl = $this; + Hooks::run( 'ResourceLoaderRegisterModules', [ &$rl ] ); if ( $config->get( 'EnableJavaScriptTest' ) === true ) { $this->registerTestModules(); @@ -404,7 +407,9 @@ class ResourceLoader implements LoggerAwareInterface { $testModules = []; $testModules['qunit'] = []; // Get other test suites (e.g. from extensions) - Hooks::run( 'ResourceLoaderTestModules', [ &$testModules, &$this ] ); + // Avoid PHP 7.1 warning from passing $this by reference + $rl = $this; + Hooks::run( 'ResourceLoaderTestModules', [ &$testModules, &$rl ] ); // Add the testrunner (which configures QUnit) to the dependencies. // Since it must be ready before any of the test suites are executed. @@ -709,7 +714,7 @@ class ResourceLoader implements LoggerAwareInterface { $module = $this->getModule( $name ); if ( $module ) { // Do not allow private modules to be loaded from the web. - // This is a security issue, see bug 34907. + // This is a security issue, see T36907. if ( $module->getGroup() === 'private' ) { $this->logger->debug( "Request for private module '$name' denied" ); $this->errors[] = "Cannot show private module \"$name\""; @@ -813,6 +818,7 @@ class ResourceLoader implements LoggerAwareInterface { * @return void */ protected function sendResponseHeaders( ResourceLoaderContext $context, $etag, $errors ) { + \MediaWiki\HeaderCallback::warnIfHeadersSent(); $rlMaxage = $this->config->get( 'ResourceLoaderMaxage' ); // Use a short cache expiry so that updates propagate to clients quickly, if: // - No version specified (shared resources, e.g. stylesheets) @@ -1211,7 +1217,7 @@ MESSAGE; $styles = (array)$styles; foreach ( $styles as $style ) { $style = trim( $style ); - // Don't output an empty "@media print { }" block (bug 40498) + // Don't output an empty "@media print { }" block (T42498) if ( $style !== '' ) { // Transform the media type based on request params and config // The way that this relies on $wgRequest to propagate request params is slightly evil @@ -1628,7 +1634,7 @@ MESSAGE; */ public function getLessCompiler( $extraVars = [] ) { // When called from the installer, it is possible that a required PHP extension - // is missing (at least for now; see bug 47564). If this is the case, throw an + // is missing (at least for now; see T49564). If this is the case, throw an // exception (caught by the installer) to prevent a fatal error later on. if ( !class_exists( 'Less_Parser' ) ) { throw new MWException( 'MediaWiki requires the less.php parser' );