From 17ab4fb2664ad5f4beff07773c31136d288c75c6 Mon Sep 17 00:00:00 2001 From: Marina Glancy Date: Mon, 22 Jun 2020 15:09:15 +0200 Subject: [PATCH] MDL-69109 core: use different cache keys for FA icon maps --- lib/classes/output/icon_system_fontawesome.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/classes/output/icon_system_fontawesome.php b/lib/classes/output/icon_system_fontawesome.php index ba4ccdbe3d4..38ad233b547 100644 --- a/lib/classes/output/icon_system_fontawesome.php +++ b/lib/classes/output/icon_system_fontawesome.php @@ -440,7 +440,10 @@ class icon_system_fontawesome extends icon_system_font { if ($this->map === []) { $cache = \cache::make('core', 'fontawesomeiconmapping'); - $this->map = $cache->get('mapping'); + // Create different mapping keys for different icon system classes, there may be several different + // themes on the same site. + $mapkey = 'mapping_'.preg_replace('/[^a-zA-Z0-9_]/', '_', get_class($this)); + $this->map = $cache->get($mapkey); if (empty($this->map)) { $this->map = $this->get_core_icon_map(); @@ -454,7 +457,7 @@ class icon_system_fontawesome extends icon_system_font { } } } - $cache->set('mapping', $this->map); + $cache->set($mapkey, $this->map); } } -- 2.43.0