- improvement use is_file() checks to avoid errors suppressed by @ which could still cause problems (https://github.com/smarty-php/smarty/issues/24)

This commit is contained in:
Uwe Tews
2015-05-05 00:41:30 +02:00
parent f14f2dcc6f
commit c5915a8c0c
8 changed files with 48 additions and 30 deletions
@@ -35,8 +35,10 @@ class Smarty_Internal_Extension_DefaultTemplateHandler
$_return = call_user_func_array($default_handler,
array($source->type, $source->name, &$_content, &$_timestamp, $source->smarty));
if (is_string($_return)) {
$source->timestamp = @filemtime($_return);
$source->exists = !!$source->timestamp;
$source->exists = is_file($_return);
if ($source->exists) {
$source->timestamp = filemtime($_return);
}
$source->filepath = $_return;
} elseif ($_return === true) {
$source->content = $_content;