Created
December 13, 2011 07:09
-
-
Save wilr/1471003 to your computer and use it in GitHub Desktop.
Check theme folder exists (sapphire). Allows site dev to delete themes/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/sapphire/core/i18n.php b/sapphire/core/i18n.php | |
index 25190b1..cbd7903 100755 | |
--- a/sapphire/core/i18n.php | |
+++ b/sapphire/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(file_exists($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); | |
+ } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment