diff --git a/etemplate/inc/class.boetemplate.inc.php b/etemplate/inc/class.boetemplate.inc.php index b60f36a4ba..43d7844031 100644 --- a/etemplate/inc/class.boetemplate.inc.php +++ b/etemplate/inc/class.boetemplate.inc.php @@ -169,11 +169,12 @@ class boetemplate extends soetemplate $row_cont = $cont[$row]; $col_row_cont = $cont[$col.$row]; - // check if name is enclosed in single quotes as argument eg. to an event handler --> quote contained quotes (' or ") - if ($name[$pos_var-1] == "'" && preg_match('/\'(\$[A-Za-z0-9_\[\]]+)\'/',$name,$matches)) + // check if name is enclosed in single quotes as argument eg. to an event handler or + // used as name for a button like "delete[$row_cont[something]]" --> quote contained quotes (' or ") + if (in_array($name[$pos_var-1],array('[',"'")) && preg_match('/[\'\[](\$[A-Za-z0-9_\[\]]+)[\'\]]+/',$name,$matches)) { eval('$value = '.$matches[1].';'); - if (is_array($value)) + if (is_array($value) && $name[$pos_var-1] == "'") // arrays are only supported for ' { foreach($value as &$val) { diff --git a/etemplate/inc/class.etemplate_request.inc.php b/etemplate/inc/class.etemplate_request.inc.php index 3c72e78ba5..01e7ab1f46 100644 --- a/etemplate/inc/class.etemplate_request.inc.php +++ b/etemplate/inc/class.etemplate_request.inc.php @@ -198,6 +198,9 @@ class etemplate_request //echo '
'.__METHOD__."($form_name,$type,".array2string($data).")
\n"; $data['type'] = $type; + // unquote single and double quotes, as this is how they get returned in $_POST + $form_name = str_replace(array('\\\'','"'),array('\'','"'),$form_name); + $this->data['to_process'][$form_name] = $data; $this->data_modified = true; } @@ -215,6 +218,9 @@ class etemplate_request //echo ''.__METHOD__."($form_name,$attribute,$value,$add_to_array)
\n"; if (!$form_name) return; + // unquote single and double quotes, as this is how they get returned in $_POST + $form_name = str_replace(array('\\\'','"'),array('\'','"'),$form_name); + if ($add_to_array) { $this->data['to_process'][$form_name][$attribute][] = $value;