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 d7961a8 commit be8e9cd
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 be8e9cd

Please sign in to comment.