diff --git a/src/IO/Reader/GZipCompressedStringReader.php b/src/IO/Reader/GZipCompressedStringReader.php index 8c43b6f..05e70e9 100644 --- a/src/IO/Reader/GZipCompressedStringReader.php +++ b/src/IO/Reader/GZipCompressedStringReader.php @@ -9,9 +9,9 @@ class GZipCompressedStringReader extends StringReader /** * @throws Exception */ - public function __construct(string $data, int $format) + public function __construct(string $data, int $format, int $maxDecompressedSize = 0) { - if (($uncompressed = @gzdecode($data)) === false) { + if (($uncompressed = @gzdecode($data, $maxDecompressedSize)) === false) { throw new Exception("Invalid GZip data"); } parent::__construct($uncompressed, $format); diff --git a/src/IO/Reader/ZLibCompressedStringReader.php b/src/IO/Reader/ZLibCompressedStringReader.php index 71c919f..98a3175 100644 --- a/src/IO/Reader/ZLibCompressedStringReader.php +++ b/src/IO/Reader/ZLibCompressedStringReader.php @@ -9,9 +9,9 @@ class ZLibCompressedStringReader extends StringReader /** * @throws Exception */ - public function __construct(string $data, int $format) + public function __construct(string $data, int $format, int $maxDecompressedSize = 0) { - if (($uncompressed = @zlib_decode($data)) === false) { + if (($uncompressed = @zlib_decode($data, $maxDecompressedSize)) === false) { throw new Exception("Invalid ZLib data"); } parent::__construct($uncompressed, $format);