BUGFIX TinyMCE cache shouldn't be shared between projects. Add SCRIPT_NAME when generating a hash for the cache filename

This commit is contained in:
Sean Harvey 2012-03-03 17:11:43 +13:00
parent 299bf8b9c6
commit 8de7b745fc

View File

@ -169,8 +169,8 @@ class TinyMCE_Compressor {
$allFiles[$i] = $file; $allFiles[$i] = $file;
} }
// Generate hash for all files // Generate hash for all files, and script path so multiple projects don't share the same cache
$hash = md5(implode('', $allFiles)); $hash = md5(implode('', $allFiles) . $_SERVER['SCRIPT_NAME']);
// Check if it supports gzip // Check if it supports gzip
$zlibOn = ini_get('zlib.output_compression') || (ini_set('zlib.output_compression', 0) === false); $zlibOn = ini_get('zlib.output_compression') || (ini_set('zlib.output_compression', 0) === false);
@ -185,7 +185,6 @@ class TinyMCE_Compressor {
// Set cache file name // Set cache file name
$cacheFile = $this->settings["cache_dir"] . "/" . $hash . ($supportsGzip ? ".gz" : ".js"); $cacheFile = $this->settings["cache_dir"] . "/" . $hash . ($supportsGzip ? ".gz" : ".js");
// Set headers // Set headers
header("Content-type: text/javascript"); header("Content-type: text/javascript");
header("Vary: Accept-Encoding"); // Handle proxies header("Vary: Accept-Encoding"); // Handle proxies
@ -337,4 +336,4 @@ class TinyMCE_Compressor {
return $content; return $content;
} }
} }
?>