Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

BUGFIX TinyMCE cache shouldn't be shared between projects. Add SCRIPT…

…_NAME when generating a hash for the cache filename
  • Loading branch information...
commit 8de7b745fc6b62e6112b6f8d47a985e459ce971c 1 parent 299bf8b
@halkyon halkyon authored
Showing with 3 additions and 4 deletions.
  1. +3 −4 thirdparty/tinymce/tiny_mce_gzip.php
View
7 thirdparty/tinymce/tiny_mce_gzip.php
@@ -169,8 +169,8 @@ public function handleRequest() {
$allFiles[$i] = $file;
}
- // Generate hash for all files
- $hash = md5(implode('', $allFiles));
+ // Generate hash for all files, and script path so multiple projects don't share the same cache
+ $hash = md5(implode('', $allFiles) . $_SERVER['SCRIPT_NAME']);
// Check if it supports gzip
$zlibOn = ini_get('zlib.output_compression') || (ini_set('zlib.output_compression', 0) === false);
@@ -185,7 +185,6 @@ public function handleRequest() {
// Set cache file name
$cacheFile = $this->settings["cache_dir"] . "/" . $hash . ($supportsGzip ? ".gz" : ".js");
-
// Set headers
header("Content-type: text/javascript");
header("Vary: Accept-Encoding"); // Handle proxies
@@ -337,4 +336,4 @@ private function getFileContents($file) {
return $content;
}
}
-?>
+
Please sign in to comment.
Something went wrong with that request. Please try again.