diff options
author | Grégoire Pineau <[email protected]> | 2020-06-30 18:00:52 +0200 |
---|---|---|
committer | Grégoire Pineau <[email protected]> | 2020-06-30 18:00:52 +0200 |
commit | be8e9cdf2d33d5ed829c6b3c9f45ce078d40b788 (patch) | |
tree | 66395cd092d51b4ce8a38321ea0476a025005ede | |
parent | d7961a84793032d9e09f865a64fa49c6b38cde70 (diff) |
Fixed memory leak in HTML5::saveHTML()
-rw-r--r-- | src/HTML5.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/HTML5.php b/src/HTML5.php index 6316e43..94faa1e 100644 --- a/src/HTML5.php +++ b/src/HTML5.php @@ -234,6 +234,10 @@ class HTML5 $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; } } |