From 7d77edd1fbce51b89b83c2203d1aae98333a3bed Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 15 Aug 2022 07:59:24 +0300 Subject: amend logic flow to fix phpstan warning in previous --- classes/urlhelper.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'classes/urlhelper.php') diff --git a/classes/urlhelper.php b/classes/urlhelper.php index cdaa6cc87..8dcb94b73 100644 --- a/classes/urlhelper.php +++ b/classes/urlhelper.php @@ -587,20 +587,20 @@ class UrlHelper { return false; } - if (!$data) { - self::$fetch_last_error = 'Successful response, but no content was received.'; - return false; - } + if ($data) { + $is_gzipped = RSSUtils::is_gzipped($data); - $is_gzipped = RSSUtils::is_gzipped($data); + if ($is_gzipped) { + $tmp = @gzdecode($data); - if ($is_gzipped && $data) { - $tmp = @gzdecode($data); + if ($tmp) $data = $tmp; + } - if ($tmp) $data = $tmp; + return $data; + } else { + self::$fetch_last_error = 'Successful response, but no content was received.'; + return false; } - - return $data; } } -- cgit v1.2.3