Skip to content

Commit

Permalink
Merge pull request #187 from lyrixx/fix-memory-leak
Browse files Browse the repository at this point in the history
Fixed memory leak in HTML5::saveHTML()
  • Loading branch information
goetas authored Jun 30, 2020
2 parents d7961a8 + be8e9cd commit ff916f1
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 @@ -234,6 +234,10 @@ public function saveHTML($dom, $options = array())
$stream = fopen('php://temp', 'wb');
$this->save($dom, $stream, array_merge($this->defaultOptions, $options));

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

fclose($stream);

return $html;
}
}

0 comments on commit ff916f1

Please sign in to comment.