mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
299bf8b9c6
commit
8de7b745fc
7
thirdparty/tinymce/tiny_mce_gzip.php
vendored
7
thirdparty/tinymce/tiny_mce_gzip.php
vendored
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
Loading…
Reference in New Issue
Block a user