From: Timo Tijhof Date: Fri, 12 May 2017 18:05:20 +0000 (+0100) Subject: resourceloader: Add filename to validateScriptFile cache key X-Git-Tag: 1.31.0-rc.0~3256^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22auteur_infos%22%2C%20%22id_auteur=%24id%22%29%20.%20%22?a=commitdiff_plain;h=3a748592f8da0095f707b6294dd39c269e56ce79;p=lhc%2Fweb%2Fwiklou.git resourceloader: Add filename to validateScriptFile cache key * Add fileName to cache key to fix T52919. The cached parsed error message contains the filename, this should be part of the cache key as otherwise two identical user scripts may report the same error message, including " on line X of page Y" where Y is whichever of the two pages first created the cache entry. * Make the cache key global instead of per-wiki. There is no need for this to be per-wiki. Bug: T52919 Change-Id: I6c2718c53be7f6384a6486a4a8718ae7f423d216 --- diff --git a/includes/resourceloader/ResourceLoaderModule.php b/includes/resourceloader/ResourceLoaderModule.php index 97f9891eeb..3ad6a84864 100644 --- a/includes/resourceloader/ResourceLoaderModule.php +++ b/includes/resourceloader/ResourceLoaderModule.php @@ -936,11 +936,12 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface { } $cache = ObjectCache::getMainWANInstance(); return $cache->getWithSetCallback( - $cache->makeKey( + $cache->makeGlobalKey( 'resourceloader', 'jsparse', self::$parseCacheVersion, - md5( $contents ) + md5( $contents ), + $fileName ), $cache::TTL_WEEK, function () use ( $contents, $fileName ) {