Przeglądaj źródła

[FileCache] Build file name solely on given parameters

Previously the cache file name was build on the original request URI
which also included the parameters. This could result in different
file name for the same request (different format). Removing the format
from the request is already done in index.php and could lead to issues
in the future (if new parameters are introduced).
logmanoriginal 7 lat temu
rodzic
commit
ac0a9a90ad
1 zmienionych plików z 1 dodań i 4 usunięć
  1. 1 4
      caches/FileCache.php

+ 1 - 4
caches/FileCache.php

@@ -107,9 +107,6 @@ class FileCache implements CacheInterface {
 	*/
 	protected function getCacheName(){
 		$this->isPrepareCache();
-
-		$stringToEncode = $_SERVER['REQUEST_URI'] . http_build_query($this->param);
-		$stringToEncode = preg_replace('/(\?|&)format=[^&]*/i', '$1', $stringToEncode);
-		return hash('sha1', $stringToEncode) . '.cache';
+		return hash('sha1', http_build_query($this->param)) . '.cache';
 	}
 }