From 7805e3e6d9d1bf485f310d51c9569f74a31fbc3e Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Wed, 28 Sep 2011 15:27:51 +1300 Subject: [PATCH] BUGFIX i18n::include_by_locale() assumes a themes directory always exists and causes error if that's not the case. Some projects don't require any themes, like pure applications. --- core/i18n.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/core/i18n.php b/core/i18n.php index 25190b1eb..6f0f45db8 100755 --- a/core/i18n.php +++ b/core/i18n.php @@ -1872,13 +1872,15 @@ class i18n extends Object { // Load translations from themes $themesBase = $base . '/themes'; - foreach(scandir($themesBase) as $theme) { - if( - strpos($theme, SSViewer::current_theme()) === 0 - && file_exists($file = "$themesBase/$theme/lang/$locale.php") - ) { - if ($force_load) include($file); - else include_once($file); + if(is_dir($themesBase)) { + foreach(scandir($themesBase) as $theme) { + if( + strpos($theme, SSViewer::current_theme()) === 0 + && file_exists($file = "$themesBase/$theme/lang/$locale.php") + ) { + if ($force_load) include($file); + else include_once($file); + } } }