Skip to content

Commit

Permalink
Merge pull request #7186 from dhensby/pulls/3.5/cache-prefix
Browse files Browse the repository at this point in the history
FIX Add unique prefix to cache stores to prevent cache leak
  • Loading branch information
Damian Mooyman committed Jul 18, 2017
2 parents fa8f0cc + b77274c commit d053c9a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion cache/Cache.php
Expand Up @@ -174,7 +174,9 @@ public static function factory($for, $frontend='Output', $frontendOptions=null)

$backend = self::$backends[$backend_name];

$basicOptions = array('cache_id_prefix' => $for);
$basicOptions = array(
'cache_id_prefix' => $for . '_' . md5(BASE_PATH) . '_',
);

if ($cache_lifetime >= 0) {
$basicOptions['lifetime'] = $cache_lifetime;
Expand Down
3 changes: 2 additions & 1 deletion core/manifest/ConfigManifest.php
Expand Up @@ -115,7 +115,8 @@ protected function getCache()
{
return SS_Cache::factory('SS_Configuration', 'Core', array(
'automatic_serialization' => true,
'lifetime' => null
'lifetime' => null,
'cache_id_prefix' => 'SS_Configuration_',
));
}

Expand Down

0 comments on commit d053c9a

Please sign in to comment.