Permalink
Browse files

BUGFIX i18n::include_by_locale() assumes a themes directory always ex…

…ists and causes error if that's not the case. Some projects don't require any themes, like pure applications.
  • Loading branch information...
1 parent 83ad8d4 commit 7805e3e6d9d1bf485f310d51c9569f74a31fbc3e @halkyon halkyon committed Sep 28, 2011
Showing with 9 additions and 7 deletions.
  1. +9 −7 core/i18n.php
View
@@ -1872,13 +1872,15 @@ static function include_by_locale($locale, $load_plugins = true, $force_load = f
// 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);
+ }
}
}

0 comments on commit 7805e3e

Please sign in to comment.