From 0ac9492a7bff5debc4537139e8e2dda66f24313b Mon Sep 17 00:00:00 2001 From: mohrt Date: Fri, 28 Dec 2001 16:53:33 +0000 Subject: [PATCH] fixed problem with using assigned var with include_php filepath --- NEWS | 2 ++ Smarty.class.php | 8 ++++---- Smarty_Compiler.class.php | 4 ++-- libs/Smarty.class.php | 8 ++++---- libs/Smarty_Compiler.class.php | 4 ++-- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/NEWS b/NEWS index 3ce02be5..ea7489a2 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ + - fixed problem with using assigned vars with {include_php ...} filepath + (Monte) Version 1.5.2 ------------- - added Smarty object as fifth argument for template resource functions diff --git a/Smarty.class.php b/Smarty.class.php index 066dc41c..0521cf38 100644 --- a/Smarty.class.php +++ b/Smarty.class.php @@ -1120,10 +1120,10 @@ function _is_trusted($resource_type, $resource_name) $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("include_php: $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("include_php: $resource_type: $resource_name is not trusted"); + $this->_syntax_error("insert: $resource_type: $resource_name is not trusted"); return false; } } @@ -1166,10 +1166,10 @@ 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("include_php: $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("include_php: $resource_type: $resource_name is not trusted"); + $this->_syntax_error("insert: $resource_type: $resource_name is not trusted"); return false; } } diff --git a/Smarty_Compiler.class.php b/Smarty_Compiler.class.php index 0e1ce11b..0dae8105 100644 --- a/Smarty_Compiler.class.php +++ b/Smarty_Compiler.class.php @@ -489,10 +489,10 @@ class Smarty_Compiler extends Smarty { if (!empty($attrs['assign'])) { $output = "assign(" . $this->_dequote($attrs['assign']).", ob_get_contents()); ob_end_clean();\n?>"; } else { - $output = ""; + $output = ''; } return $output; diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 066dc41c..0521cf38 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -1120,10 +1120,10 @@ function _is_trusted($resource_type, $resource_name) $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("include_php: $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("include_php: $resource_type: $resource_name is not trusted"); + $this->_syntax_error("insert: $resource_type: $resource_name is not trusted"); return false; } } @@ -1166,10 +1166,10 @@ 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("include_php: $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("include_php: $resource_type: $resource_name is not trusted"); + $this->_syntax_error("insert: $resource_type: $resource_name is not trusted"); return false; } } diff --git a/libs/Smarty_Compiler.class.php b/libs/Smarty_Compiler.class.php index 0e1ce11b..0dae8105 100644 --- a/libs/Smarty_Compiler.class.php +++ b/libs/Smarty_Compiler.class.php @@ -489,10 +489,10 @@ class Smarty_Compiler extends Smarty { if (!empty($attrs['assign'])) { $output = "assign(" . $this->_dequote($attrs['assign']).", ob_get_contents()); ob_end_clean();\n?>"; } else { - $output = ""; + $output = ''; } return $output;