mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-07 11:54:26 +02:00
let smarty throw error when template source is not readable
This commit is contained in:
@@ -1548,7 +1548,7 @@ class Smarty
|
|||||||
$params['source_content'] = $this->_read_file($_resource_name);
|
$params['source_content'] = $this->_read_file($_resource_name);
|
||||||
}
|
}
|
||||||
$params['resource_timestamp'] = filemtime($_resource_name);
|
$params['resource_timestamp'] = filemtime($_resource_name);
|
||||||
$_return = is_file($_resource_name);
|
$_return = is_file($_resource_name) && is_readable($_resource_name);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -1711,7 +1711,7 @@ class Smarty
|
|||||||
*/
|
*/
|
||||||
function _read_file($filename)
|
function _read_file($filename)
|
||||||
{
|
{
|
||||||
if ( file_exists($filename) && ($fd = @fopen($filename, 'rb')) ) {
|
if ( file_exists($filename) && is_readable($filename) && ($fd = @fopen($filename, 'rb')) ) {
|
||||||
$contents = '';
|
$contents = '';
|
||||||
while (!feof($fd)) {
|
while (!feof($fd)) {
|
||||||
$contents .= fread($fd, 8192);
|
$contents .= fread($fd, 8192);
|
||||||
|
Reference in New Issue
Block a user