From b0377ef865164b5230a4fef4d2ca5a8a4c04ff58 Mon Sep 17 00:00:00 2001 From: Ian Date: Fri, 2 Dec 2011 16:23:16 +0100 Subject: [PATCH] smarty compile dir - better exeption handler --- include/serendipity_smarty_class.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/serendipity_smarty_class.inc.php b/include/serendipity_smarty_class.inc.php index e797c6ae..93da207c 100644 --- a/include/serendipity_smarty_class.inc.php +++ b/include/serendipity_smarty_class.inc.php @@ -123,8 +123,8 @@ class Serendipity_Smarty extends Smarty $this->setConfigDir(array(S9Y_TEMPLATE_DEFAULT)); if (!is_dir($this->getCompileDir()) || !is_writable($this->getCompileDir())) { - // howto: better throw exception depending on context or 500/503 header here ?? - throw new Exception(printf(DIRECTORY_WRITE_ERROR.'
', $this->getCompileDir())); + if(ini_get('display_errors') == 0 || ini_get('display_errors') == 'off') printf(DIRECTORY_WRITE_ERROR, $this->getCompileDir()); + trigger_error(sprintf(DIRECTORY_WRITE_ERROR, $this->getCompileDir()), E_USER_ERROR); } #cache# $this->setCacheDir($serendipity['serendipityPath'] . 'cache'); // (enable #cache# properties)