cleanup formatting

This commit is contained in:
mohrt
2002-01-24 20:27:54 +00:00
parent 548274b70d
commit 1d3bfa0070
2 changed files with 14 additions and 12 deletions

View File

@@ -125,9 +125,9 @@ class Smarty
'PHP_TAGS' => false,
'MODIFIER_FUNCS' => array('count')
);
var $trusted_dir = array(); // directories where trusted templates
var $trusted_dir = array(); // directories where trusted templates & php scripts
// reside ($security is disabled during their
// execution).
// inclusion/execution).
var $left_delimiter = '{'; // template tag delimiters.
var $right_delimiter = '}';
@@ -1162,7 +1162,8 @@ function _run_insert_handler($args)
$this->_parse_file_path($this->trusted_dir, $this->_dequote($args['script']), $resource_type, $resource_name);
if ($this->security) {
if ( $resource_type != 'file' || !@is_file($resource_name) ) {
$this->_syntax_error("insert: $resource_type: $resource_name is not readable"); return false;
$this->_syntax_error("insert: $resource_type: $resource_name is not readable");
return false;
}
if ( !$this->_is_trusted($resource_type, $resource_name) ) {
$this->_syntax_error("insert: $resource_type: $resource_name is not trusted");
@@ -1395,7 +1396,7 @@ function _run_insert_handler($args)
function _write_cache_file($tpl_file, $cache_id, $compile_id, $results)
{
// determine if insert tags are present
if (strpos($results,$this->_smarty_md5.'{insert_cache')) {
if (strpos($results,$this->_smarty_md5)) {
$this->_cache_info['insert_tags'] = true;
}

View File

@@ -125,9 +125,9 @@ class Smarty
'PHP_TAGS' => false,
'MODIFIER_FUNCS' => array('count')
);
var $trusted_dir = array(); // directories where trusted templates
var $trusted_dir = array(); // directories where trusted templates & php scripts
// reside ($security is disabled during their
// execution).
// inclusion/execution).
var $left_delimiter = '{'; // template tag delimiters.
var $right_delimiter = '}';
@@ -1162,7 +1162,8 @@ function _run_insert_handler($args)
$this->_parse_file_path($this->trusted_dir, $this->_dequote($args['script']), $resource_type, $resource_name);
if ($this->security) {
if ( $resource_type != 'file' || !@is_file($resource_name) ) {
$this->_syntax_error("insert: $resource_type: $resource_name is not readable"); return false;
$this->_syntax_error("insert: $resource_type: $resource_name is not readable");
return false;
}
if ( !$this->_is_trusted($resource_type, $resource_name) ) {
$this->_syntax_error("insert: $resource_type: $resource_name is not trusted");
@@ -1395,7 +1396,7 @@ function _run_insert_handler($args)
function _write_cache_file($tpl_file, $cache_id, $compile_id, $results)
{
// determine if insert tags are present
if (strpos($results,$this->_smarty_md5.'{insert_cache')) {
if (strpos($results,$this->_smarty_md5)) {
$this->_cache_info['insert_tags'] = true;
}