From: Timo Tijhof Date: Tue, 31 Mar 2015 18:01:15 +0000 (+0100) Subject: resourceloader: De-duplicate $files in ResourceLoaderFileModule::getModifiedTime() X-Git-Tag: 1.31.0-rc.0~11918^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dcompta/operations/modifier.php?a=commitdiff_plain;h=58ecbdb61b3f2b6140ac70e89bbd3342e4bb8aea;p=lhc%2Fweb%2Fwiklou.git resourceloader: De-duplicate $files in ResourceLoaderFileModule::getModifiedTime() lessc::allParsedFiles() always includes the main file we already know about. As such needlessly causing it to be queried multiple times. Change-Id: Icd2c11d93d6491664fcf58a18bfe6e2932689774 --- diff --git a/includes/resourceloader/ResourceLoaderFileModule.php b/includes/resourceloader/ResourceLoaderFileModule.php index db10b2c74e..671098e1f8 100644 --- a/includes/resourceloader/ResourceLoaderFileModule.php +++ b/includes/resourceloader/ResourceLoaderFileModule.php @@ -573,6 +573,10 @@ class ResourceLoaderFileModule extends ResourceLoaderModule { $files = array_map( array( $this, 'getLocalPath' ), $files ); // File deps need to be treated separately because they're already prefixed $files = array_merge( $files, $this->getFileDependencies( $context->getSkin() ) ); + // Filter out any duplicates from getFileDependencies() and others. + // Most commonly introduced by compileLessFile(), which always includes the + // entry point Less file we already know about. + $files = array_values( array_unique( $files ) ); // If a module is nothing but a list of dependencies, we need to avoid // giving max() an empty array