From: hickert Date: Wed, 22 Feb 2006 05:46:37 +0000 (+0000) Subject: Fixed $this overwrite X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d8f38ca26d1afaaed6ce2f37c1a7519338d0356a;p=gosa.git Fixed $this overwrite git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2714 594d385d-05f5-0310-b6e9-bd551577e9d8 --- 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 }