From 3778a672740c384211e55bef7ecbd7f95c3194c2 Mon Sep 17 00:00:00 2001 From: Normann Lou Date: Mon, 9 Feb 2009 01:55:42 +0000 Subject: [PATCH] BUGFIX: i18n::include_by_locale() should skip check the web root level and ../webroot level for language file, this is not only "not necessary" but also "must" because some server configuration prevent from any file access above the site root folder. git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@71499 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/i18n.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/i18n.php b/core/i18n.php index 3e9dd4ebd..dd9d9fbd6 100755 --- a/core/i18n.php +++ b/core/i18n.php @@ -1068,6 +1068,9 @@ class i18n extends Object { static function include_by_locale($locale) { $topLevel = scandir(Director::baseFolder()); foreach($topLevel as $module) { + //$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 == ".." || $module == ".") continue; if (file_exists(Director::getAbsFile("$module/_config.php")) && file_exists($file = Director::getAbsFile("$module/lang/$locale.php"))) { include_once($file);