Fix key dereferencing

This commit is contained in:
Filippo Tessarotto 2012-11-25 09:01:45 +01:00
parent 9ad2d65c8d
commit e525c695dd
1 changed files with 6 additions and 6 deletions

View File

@ -826,20 +826,20 @@ class PHPExcel_Worksheet_AutoFilter
if (is_object($value)) { if (is_object($value)) {
if ($key == '_workSheet') { if ($key == '_workSheet') {
// Detach from worksheet // Detach from worksheet
$this->$key = NULL; $this->{$key} = NULL;
} else { } else {
$this->$key = clone $value; $this->{$key} = clone $value;
} }
} elseif ((is_array($value)) && ($key == '_columns')) { } elseif ((is_array($value)) && ($key == '_columns')) {
// The columns array of PHPExcel_Worksheet_AutoFilter objects // The columns array of PHPExcel_Worksheet_AutoFilter objects
$this->$key = array(); $this->{$key} = array();
foreach ($value as $k => $v) { foreach ($value as $k => $v) {
$this->$key[$k] = clone $v; $this->{$key}[$k] = clone $v;
// attach the new cloned Column to this new cloned Autofilter object // attach the new cloned Column to this new cloned Autofilter object
$this->$key[$k]->setParent($this); $this->{$key}[$k]->setParent($this);
} }
} else { } else {
$this->$key = $value; $this->{$key} = $value;
} }
} }
} }