]> git.mjollnir.org Git - s9y.git/commitdiff
Die on not writable directory. People seem to not get along with the
authorgarvinhicking <garvinhicking>
Sat, 31 Dec 2005 15:19:45 +0000 (15:19 +0000)
committergarvinhicking <garvinhicking>
Sat, 31 Dec 2005 15:19:45 +0000 (15:19 +0000)
Smarty error
"Unable to read resource ''"
pretty well.

include/functions_smarty.inc.php

index 5eefdf7e09c501a4ae06f43e1e59cde9f1f7188a..e64f702d2508a85875795b9fbf07de11d1a73f35 100644 (file)
@@ -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');
     }