sdglhm / dompdf

Automatically exported from code.google.com/p/dompdf
0 stars 0 forks source link

Possible bug in clear_object function #289

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. non - just a review of source code
2.
3.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
0.6.0 beta 2

Please provide any additional information below.
in file include/functions.inc.php
following code at line 931

function clear_object(&$object) {
  if ( is_object($object) ) {
    foreach (array_keys((array)$object) as $key) {
                                           ^^^^ 
      clear_object($property);
                   ^^^^^^^^^
    }
    foreach(get_class_vars(get_class($object)) as $property => $value) {
      clear_object($property);
    }
  }
  $object = null;
  unset($object);
}

In the function above the first 'foreach' loop - each iteration provides '$key' 
and the subsequent call within the loop uses '$property'. I suspect this is a 
bug/typo and that the object is not unset properly and may cause additional 
delays trying to unset variables/objects that dont exist and leaving the 
original ones intact.

Original issue reported on code.google.com by lukecjco...@gmail.com on 26 May 2011 at 3:01

GoogleCodeExporter commented 9 years ago
There does appear to be a typo in the variable reference. Addressed in r396

Thanks for the notice.

Original comment by eclecticgeek on 26 May 2011 at 6:19

GoogleCodeExporter commented 9 years ago

Original comment by eclecticgeek on 30 May 2013 at 5:15