From f073fd9f5b5d529f7a4fe9fb595b3f6bb4d49aa0 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Thu, 27 Aug 2009 03:09:34 +0000 Subject: [PATCH] BUGFIX Limiting i18n::include_by_locale() to scan directories only git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@85310 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/i18n.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/i18n.php b/core/i18n.php index fb95dbe7e..25379b6ad 100755 --- a/core/i18n.php +++ b/core/i18n.php @@ -1413,7 +1413,7 @@ class i18n extends Object { // if language table isn't loaded for this locale, get it for each of the modules if(!isset($lang[$locale])) i18n::include_by_locale($locale); - + // fallback to the passed $string if no translation is present $transEntity = isset($lang[$locale][$class][$realEntity]) ? $lang[$locale][$class][$realEntity] : $string; @@ -1738,8 +1738,12 @@ class i18n extends Object { //$topLevel is the website root, some server is configurated not to allow excess website root's parent level //and we don't need to check website root's parent level and websit root level for its lang folder, so we skip these 2 levels checking. if($module[0] == '.') continue; - if (file_exists("$base/$module/_config.php") && - file_exists($file = "$base/$module/lang/$locale.php")) { + + if ( + is_dir("$base/$module") + && file_exists("$base/$module/_config.php") + && file_exists($file = "$base/$module/lang/$locale.php") + ) { include_once($file); } }