updated fetch to give proper warning when fetching unreadable or nonexistant files

This commit is contained in:
mohrt
2001-10-25 19:57:52 +00:00
parent 32b9ebfa68
commit b483c5a19c
2 changed files with 8 additions and 2 deletions

2
NEWS
View File

@@ -1,3 +1,5 @@
- update fetch function to give proper warning when fetching a non-readable
or non-existant file (Monte)
- fixed problem with newline at the end of included templates (Monte, Andrei)
- added feature to regenerate cache if compile_check is enabled and an
involved template or config file gets modified (Monte)

View File

@@ -572,10 +572,14 @@ function smarty_func_fetch($args, &$smarty_obj) {
}
}
if (!$resource_is_secure) {
$smarty_obj->_trigger_error_msg("(secure mode) fetching '$file' is not allowed");
$smarty_obj->_trigger_error_msg("(secure mode) fetch '$file' is not allowed");
return;
}
}
}
if (!@is_readable($file)) {
$smarty_obj->_trigger_error_msg("fetch cannot read file '$file'");
return;
}
readfile($file);
}