Skip to content

Commit

Permalink
FIX Add unique prefix to cache stores to prevent cache leak
Browse files Browse the repository at this point in the history
  • Loading branch information
dhensby committed Jul 18, 2017
1 parent fa8f0cc commit b77274c
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 b77274c

Please sign in to comment.