added file and line-number-information to error-messages regarding

assigned objects an an error messages regarding modifiers with
security.
This commit is contained in:
messju
2004-01-29 10:38:12 +00:00
parent 4fce643842
commit 607cf5d0f4

View File

@@ -849,9 +849,9 @@ class Smarty_Compiler extends Smarty {
$postfix = '';
$newline = '';
if(!is_object($this->_reg_objects[$object][0])) {
$this->_trigger_fatal_error("registered '$object' is not an object");
$this->_trigger_fatal_error("registered '$object' is not an object" , $this->_current_file, $this->_current_line_no, __FILE__, __LINE__);
} elseif(!empty($this->_reg_objects[$object][1]) && !in_array($obj_comp, $this->_reg_objects[$object][1])) {
$this->_trigger_fatal_error("'$obj_comp' is not a registered component of object '$object'");
$this->_trigger_fatal_error("'$obj_comp' is not a registered component of object '$object'", $this->_current_file, $this->_current_line_no, __FILE__, __LINE__);
} elseif(method_exists($this->_reg_objects[$object][0], $obj_comp)) {
// method
if(in_array($obj_comp, $this->_reg_objects[$object][3])) {
@@ -1891,7 +1891,7 @@ class Smarty_Compiler extends Smarty {
&& !$this->_get_plugin_filepath('modifier', $_modifier_name)
&& function_exists($_modifier_name)) {
if ($this->security && !in_array($_modifier_name, $this->security_settings['MODIFIER_FUNCS'])) {
$this->_trigger_fatal_error("[plugin] (secure mode) modifier '$_modifier_name' is not allowed" , $_tpl_file, $_tpl_line, __FILE__, __LINE__);
$this->_trigger_fatal_error("[plugin] (secure mode) modifier '$_modifier_name' is not allowed" , $this->_current_file, $this->_current_line_no, __FILE__, __LINE__);
} else {
$this->_plugins['modifier'][$_modifier_name] = array($_modifier_name, null, null, false);
}