mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
updated fetch to give proper warning when fetching unreadable or nonexistant files
This commit is contained in:
2
NEWS
2
NEWS
@@ -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)
|
- fixed problem with newline at the end of included templates (Monte, Andrei)
|
||||||
- added feature to regenerate cache if compile_check is enabled and an
|
- added feature to regenerate cache if compile_check is enabled and an
|
||||||
involved template or config file gets modified (Monte)
|
involved template or config file gets modified (Monte)
|
||||||
|
@@ -572,10 +572,14 @@ function smarty_func_fetch($args, &$smarty_obj) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!$resource_is_secure) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!@is_readable($file)) {
|
||||||
|
$smarty_obj->_trigger_error_msg("fetch cannot read file '$file'");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
readfile($file);
|
readfile($file);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user