From ba6997ce00805307fe18cd04ce2eb4c47c39f036 Mon Sep 17 00:00:00 2001 From: marcus Date: Thu, 19 Feb 2009 14:52:25 +0000 Subject: Fixed strange infinite loop on language loading. git-svn-id: https://code.elgg.org/elgg/trunk@2813 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/languages.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'engine/lib/languages.php') diff --git a/engine/lib/languages.php b/engine/lib/languages.php index 664285996..7aacf5ac5 100644 --- a/engine/lib/languages.php +++ b/engine/lib/languages.php @@ -125,7 +125,7 @@ // Make a note of this path just incase we need to register this language later if(!isset($CONFIG->language_paths)) $CONFIG->language_paths = array(); - $CONFIG->language_paths[] = $path; + $CONFIG->language_paths[$path] = true; // Get the current language based on site defaults and user preference $current_language = get_current_language(); @@ -162,8 +162,13 @@ { global $CONFIG; - foreach ($CONFIG->language_paths as $path) - register_translations($path, true); + static $LANG_RELOAD_ALL_RUN; + if ($LANG_RELOAD_ALL_RUN) return null; + + foreach ($CONFIG->language_paths as $path => $dummy) + register_translations($path, true); + + $LANG_RELOAD_ALL_RUN = true; } /** -- cgit v1.2.3