Skip to content

Commit

Permalink
Fixed memory leak in HTML5::saveHTML()
Browse files Browse the repository at this point in the history
  • Loading branch information
lyrixx committed Jun 30, 2020
1 parent cadcfaa commit 7f3c3d8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/HTML5.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,10 @@ public function saveHTML($dom, $options = array())
$stream = fopen('php://temp', 'w');
$this->save($dom, $stream, array_merge($this->getOptions(), $options));

return stream_get_contents($stream, - 1, 0);
$html = stream_get_contents($stream, -1, 0);

fclose($stream);

return $html;
}
}

0 comments on commit 7f3c3d8

Please sign in to comment.