From d2d03eb60b0d8cafb22460ecc21b459bb24be39b Mon Sep 17 00:00:00 2001 From: damian Date: Sun, 19 Aug 2018 17:16:04 +1000 Subject: [PATCH] Added error if an invalid theme is found. --- src/bootstrap.php | 5 +++++ 1 file changed, 5 insertions(+) mode change 100644 => 100755 src/bootstrap.php diff --git a/src/bootstrap.php b/src/bootstrap.php old mode 100644 new mode 100755 index 6f374c6f..29f67225 --- a/src/bootstrap.php +++ b/src/bootstrap.php @@ -72,6 +72,11 @@ $router = new psm\Router(); // this may seem insignificant, but right now lots of functions depend on the following global var definition: $db = $router->getService('db'); +// check if we have a valid theme, error if we don't +if (!file_exists(PSM_PATH_SRC.'templates/'.PSM_THEME)) { + trigger_error("Selected theme '".PSM_THEME."' does not exist in templates folder. Please check your config.php for your PSM_THEME, set back to 'default' if unsure.", E_USER_ERROR); +} + // sanity check! if (!defined('PSM_INSTALL') || !PSM_INSTALL) { if ($db->getDbHost() === null) {