Issue #316: Ensure Container caches have safe prefixes
authorChris Burgess <chrisburgess@catalyst.net.nz>
Fri, 10 Aug 2018 11:44:34 +0000 (23:44 +1200)
committerChris Burgess <chrisburgess@catalyst.net.nz>
Fri, 10 Aug 2018 11:44:34 +0000 (23:44 +1200)
CRM/Utils/Cache.php

index 358f260181e9b593e44d967613c5f26141bd5893..af2bb835753b6793d5e1a394f15652f4e147f4c7 100644 (file)
@@ -169,6 +169,10 @@ class CRM_Utils_Cache {
   public static function create($params = array()) {
     $types = (array) $params['type'];
 
+    if (!empty($params['name'])) {
+      $params['name'] = CRM_Core_BAO_Cache::cleanKey($params['name']);
+    }
+
     foreach ($types as $type) {
       switch ($type) {
         case '*memory*':