diff --git a/classes/template/TemplateHandler.class.php b/classes/template/TemplateHandler.class.php index d6a56fd2f..86d77e155 100644 --- a/classes/template/TemplateHandler.class.php +++ b/classes/template/TemplateHandler.class.php @@ -93,11 +93,16 @@ class TemplateHandler { // verify arguments $tpl_path = trim(preg_replace('@^' . preg_quote(\RX_BASEDIR, '@') . '|\./@', '', str_replace('\\', '/', $tpl_path)), '/') . '/'; - if($tpl_path === '/' || !is_dir($tpl_path)) + if($tpl_path === '/') + { + $tpl_path = ''; + } + elseif(!is_dir(\RX_BASEDIR . $tpl_path)) { $this->resetState(); return; } + if(!file_exists(\RX_BASEDIR . $tpl_path . $tpl_filename) && file_exists(\RX_BASEDIR . $tpl_path . $tpl_filename . '.html')) { $tpl_filename .= '.html'; diff --git a/modules/page/page.view.php b/modules/page/page.view.php index 4a7886360..d408c3aea 100644 --- a/modules/page/page.view.php +++ b/modules/page/page.view.php @@ -241,7 +241,7 @@ class pageView extends page $oTemplate = TemplateHandler::getInstance(); $real_target_dir = dirname($real_target_file); $tmp_cache_file = preg_replace('/\.cache\.php$/', '.compiled.php', $cache_file); - $content = $oTemplate->compileDirect($real_target_dir, basename($real_target_file)); + $content = $oTemplate->compileDirect($real_target_dir . '/', basename($real_target_file)); $success = Rhymix\Framework\Storage::write($tmp_cache_file, $content); if (!$success) {