What will reproduce the problem?
include( 'ganon.php' );
$html = str_get_dom( '<html><body>foo bar<p>foobar</p><?php echo "foobar";
?></body></html>' );
echo $html;
What is the expected output? What do you see instead?
Expected:
<html><body>foo bar<p>foobar</p><?php echo "foobar"; ?></body></html>
Got:
PHP Warning: Invalid argument supplied for foreach()
<html><body>foo bar<p>foobar</p><?php echo "foobar"; ?></body></html>
Which version are you using?
rev78
Please provide any additional information below.
Easy fix; in function toString_attributes( ) surround:
foreach($this->attributes as $a => $v) {
$s .= ' '.$a.(((!$this->attribute_shorttag) || ($this->attributes[$a] !== $a)) ? '="'.htmlspecialchars($this->attributes[$a], ENT_QUOTES,$
}
with:
if(is_array($this->attributes)){
...
}
Original issue reported on code.google.com by stef...@balocco.name on 2 Sep 2013 at 10:52
Original issue reported on code.google.com by
stef...@balocco.name
on 2 Sep 2013 at 10:52