diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-01-04 00:05:18 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-01-04 00:05:18 +0000 |
commit | 42c185e672955c77559223c055263e1bc8d2e865 (patch) | |
tree | 19f37cc492bb86bc24fd95a658c40cd37ac15bd5 /modules | |
parent | 311a25cae3a7ce411138466c474bf24b0e758210 (diff) | |
download | brdo-42c185e672955c77559223c055263e1bc8d2e865.tar.gz brdo-42c185e672955c77559223c055263e1bc8d2e865.tar.bz2 |
#320686 by Arancaytar and Davy Van Den Bremt: Don't rebuild locale cache when is not set.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/locale/locale.module | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/locale/locale.module b/modules/locale/locale.module index e588fbbb4..b5c3f4173 100644 --- a/modules/locale/locale.module +++ b/modules/locale/locale.module @@ -611,8 +611,9 @@ function locale($string = NULL, $context = NULL, $langcode = NULL, $reset = FALS $langcode = isset($langcode) ? $langcode : $language->language; - // Store database cached translations in a static var. - if (!isset($locale_t[$langcode])) { + // Store database cached translations in a static variable. Only build the + // cache after $language has been set to avoid an unnecessary cache rebuild. + if (!isset($locale_t[$langcode]) && isset($language)) { $locale_t[$langcode] = array(); // Disabling the usage of string caching allows a module to watch for // the exact list of strings used on a page. From a performance |