diff --git a/changelog.txt b/changelog.txt index 8cdeec5..0f887cc 100644 --- a/changelog.txt +++ b/changelog.txt @@ -6,6 +6,7 @@ * [New] Ignore Emacs and Nano tmp files like: "~", "#"; in content folder * [New] Ignore hidden files in content folder * [Fixed] - empty title/date headers + * [Fixed] - Error handling on wrong theme name 2013.05.07 - version 0.6.2 * [Changed] Replaced glob_recursive with get_files diff --git a/lib/pico.php b/lib/pico.php index 1cb10d4..c1140d7 100644 --- a/lib/pico.php +++ b/lib/pico.php @@ -79,6 +79,11 @@ class Pico { // Load the theme $this->run_hooks('before_twig_register'); Twig_Autoloader::register(); + + if(!is_dir(THEMES_DIR . $settings['theme'])) { + die(sprintf("Can't open defined theme: %s in dir %s", $settings['theme'], THEMES_DIR)); + } + $loader = new Twig_Loader_Filesystem(THEMES_DIR . $settings['theme']); $twig = new Twig_Environment($loader, $settings['twig_config']); $twig->addExtension(new Twig_Extension_Debug());