From 3f65352c06a67f2b84bb421e61a267517c8efe96 Mon Sep 17 00:00:00 2001 From: Steffen Lange Date: Tue, 1 Jun 2021 12:26:32 +0200 Subject: [PATCH] Decompress fetched response data --- PatchBase.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/PatchBase.php b/PatchBase.php index 37f48cd..a787d21 100644 --- a/PatchBase.php +++ b/PatchBase.php @@ -57,6 +57,15 @@ abstract class PatchBase { } return false; } + protected function fetch_gzip(string $url) : bool { + $str = $this->curl($url); + if ($str) { + if (!($this->data = gzdecode($str))) + return false; + return true; + } + return false; + } protected function parse(string $re) : bool { if ($str = $this->regex_str($re)) { $this->patch->setVersion($str, true);