[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).
This commit is contained in:
logmanoriginal 2016-10-08 15:17:08 +02:00
parent 5ccde61a19
commit ac0a9a90ad

View file

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