From 533b36c546906a94df19f44a3b2b1823dccd9a48 Mon Sep 17 00:00:00 2001 From: Tymoteusz Motylewski Date: Wed, 3 Jun 2020 12:32:51 +0200 Subject: [PATCH] Add runtime cache in one more place in Zend_Data Related https://github.com/OpenMage/magento-lts/pull/918 --- lib/Zend/Locale/Data.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/Zend/Locale/Data.php b/lib/Zend/Locale/Data.php index a3686da3b0c..f295fd01b26 100644 --- a/lib/Zend/Locale/Data.php +++ b/lib/Zend/Locale/Data.php @@ -343,8 +343,8 @@ public static function getList($locale, $path, $value = false) $val = urlencode($val); $id = self::_filterCacheId('Zend_LocaleL_' . $locale . '_' . $path . '_' . $val); - // add runtime cache to avoid callng cache backend multiple times during one request - if ( isset(self::$_localCache[$id])) { + // add runtime cache to avoid calling cache backend multiple times during one request + if (isset(self::$_localCache[$id])) { return self::$_localCache[$id]; } if (!self::$_cacheDisabled && ($result = self::$_cache->load($id))) { @@ -1000,6 +1000,11 @@ public static function getContent($locale, $path, $value = false) } $val = urlencode($val); $id = self::_filterCacheId('Zend_LocaleC_' . $locale . '_' . $path . '_' . $val); + + // add runtime cache to avoid calling cache backend multiple times during one request + if (isset(self::$_localCache[$id])) { + return self::$_localCache[$id]; + } if (!self::$_cacheDisabled && ($result = self::$_cache->load($id))) { $result = unserialize($result); self::$_localCache[$id] = $result;