From: garvinhicking Date: Sat, 31 Dec 2005 15:19:45 +0000 (+0000) Subject: Die on not writable directory. People seem to not get along with the X-Git-Tag: 0.9.1~4 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=faf458c72090bd4d12a04bb3b31418716569d8db;p=s9y.git Die on not writable directory. People seem to not get along with the Smarty error "Unable to read resource ''" pretty well. --- diff --git a/include/functions_smarty.inc.php b/include/functions_smarty.inc.php index 5eefdf7..e64f702 100644 --- a/include/functions_smarty.inc.php +++ b/include/functions_smarty.inc.php @@ -178,6 +178,11 @@ function serendipity_smarty_init() { $serendipity['serendipityPath'] . $serendipity['templatePath'] . 'default' ); $serendipity['smarty']->compile_dir = $serendipity['serendipityPath'] . PATH_SMARTY_COMPILE; + + if (!is_dir($serendipity['smarty']->compile_dir) || !is_writable($serendipity['smarty']->compile_dir)) { + serendipity_die(sprintf(DIRECTORY_WRITE_ERROR, $serendipity['smarty']->compile_dir)); + } + $serendipity['smarty']->config_dir = &$serendipity['smarty']->template_dir[0]; $serendipity['smarty']->secure_dir = array($serendipity['serendipityPath'] . $serendipity['templatePath']); $serendipity['smarty']->security_settings['MODIFIER_FUNCS'] = array('sprintf', 'sizeof', 'count', 'rand'); @@ -222,7 +227,7 @@ function serendipity_smarty_init() { $category_info = serendipity_fetchCategoryInfo($category); } } - + if (!isset($serendipity['smarty_vars']['head_link_stylesheet'])) { $serendipity['smarty_vars']['head_link_stylesheet'] = serendipity_rewriteURL('serendipity.css'); }