drop fallback for templates_c, die() instead

Using /tmp/ as fallback is insecure (predictible filenames in a
world-writeable directory enable symlink attacks). Better die() with an
useful error message.
pull/52/head
Christian Boltz 8 years ago
parent 0ec24885e6
commit e3a701ba24
No known key found for this signature in database
GPG Key ID: C6A682EA63C82F1C

@ -21,9 +21,9 @@ class PFASmarty {
$this->template->setCompileDir($templates_c); $this->template->setCompileDir($templates_c);
} }
else { else {
$this->template->compile_check = false; # unfortunately there's no sane way to just disable compiling of templates
$this->template->caching = false; error_log("ERROR: directory $templates_c doesn't exist or isn't writeable for the webserver");
$this->template->setCompileDir(sys_get_temp_dir()); die("ERROR: the templates_c directory doesn't exist or isn't writeable for the webserver");
} }
$this->template->setConfigDir(dirname(__FILE__) . '/configs'); $this->template->setConfigDir(dirname(__FILE__) . '/configs');

Loading…
Cancel
Save