From 53e31e6d6222725f5152e8bea870fd248868b1bf Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 19 Jul 2009 06:03:04 +0000 Subject: - Patch #523694 by catch: improve performance of t(). --- includes/common.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'includes') diff --git a/includes/common.inc b/includes/common.inc index 487a716e9..1ac613b73 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -1138,7 +1138,7 @@ function fix_gpc_magic() { */ function t($string, array $args = array(), array $options = array()) { global $language; - $custom_strings = &drupal_static(__FUNCTION__); + static $custom_strings; // Merge in default. if (empty($options['langcode'])) { @@ -1163,7 +1163,7 @@ function t($string, array $args = array(), array $options = array()) { // We don't use drupal_function_exists() here, because it breaks the testing // framework if the locale module is enabled in the parent site (we cannot // unload functions in PHP). - elseif (module_exists('locale') && $options['langcode'] != 'en') { + elseif (function_exists('locale') && $options['langcode'] != 'en') { $string = locale($string, $options['context'], $options['langcode']); } if (empty($args)) { -- cgit v1.2.3