From: Timo Tijhof Date: Wed, 22 Feb 2017 21:09:06 +0000 (-0800) Subject: resourceloader: Optimize WikiModule preload for reqs without wiki modules X-Git-Tag: 1.31.0-rc.0~4023^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20%20%20%24self2%20.%20%20%20%22&var_mode_affiche=boucle?a=commitdiff_plain;h=49948457ecf96838473503049745548434a04262;p=lhc%2Fweb%2Fwiklou.git resourceloader: Optimize WikiModule preload for reqs without wiki modules Currently it was still going through fetchTitleInfo() with an empty array on the majority of requests without wiki modules, e.g. load.php?modules=jquery. Bug: T158813 Change-Id: Ie33a2b4da572bb30b2e7a69db07790724ec2f03f --- diff --git a/includes/resourceloader/ResourceLoaderWikiModule.php b/includes/resourceloader/ResourceLoaderWikiModule.php index 14d6e056e0..e8574f4833 100644 --- a/includes/resourceloader/ResourceLoaderWikiModule.php +++ b/includes/resourceloader/ResourceLoaderWikiModule.php @@ -357,6 +357,11 @@ class ResourceLoaderWikiModule extends ResourceLoaderModule { } } + if ( !$wikiModules ) { + // Nothing to preload + return; + } + $pageNames = array_keys( $allPages ); sort( $pageNames ); $hash = sha1( implode( '|', $pageNames ) );