From d8f38ca26d1afaaed6ce2f37c1a7519338d0356a Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 22 Feb 2006 05:46:37 +0000 Subject: [PATCH] Fixed $this overwrite git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2714 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../php_writeexcel/class.writeexcel_format.inc.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/php_writeexcel/class.writeexcel_format.inc.php b/include/php_writeexcel/class.writeexcel_format.inc.php index 1523d3710..144923f41 100644 --- a/include/php_writeexcel/class.writeexcel_format.inc.php +++ b/include/php_writeexcel/class.writeexcel_format.inc.php @@ -119,7 +119,16 @@ class writeexcel_format { */ function copy($other) { $xf = $this->_xf_index; // Backup XF index - $this = $other; // Copy properties + + /* A better way to copy member vars, ... won't cause fatal errors in PHP5. + The only thing i can understand is : For what is this function used, + it is never used by any object, as I can see in the source code. + ... + */ + foreach(get_object_vars($other) as $var => $val){ + $this->$var = $val; + } +// $this = $other; // Copy properties $this->_xf_index = $xf; // Restore XF index } -- 2.30.2