From a5517fe857535163d5989778108fd9d7eb891707 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 21 Dec 2018 17:50:16 +0300 Subject: fetch_file_contents: decompress gzipped data af_readability: remove utf8 preamble hack --- include/functions.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'include/functions.php') diff --git a/include/functions.php b/include/functions.php index 1d83a41da..24c251bd3 100755 --- a/include/functions.php +++ b/include/functions.php @@ -437,6 +437,14 @@ curl_close($ch); + $is_gzipped = RSSUtils::is_gzipped($contents); + + if ($is_gzipped) { + $tmp = @gzdecode($contents); + + if ($tmp) $contents = $tmp; + } + return $contents; } else { @@ -522,6 +530,15 @@ return false; } + + $is_gzipped = RSSUtils::is_gzipped($data); + + if ($is_gzipped) { + $tmp = @gzdecode($data); + + if ($tmp) $data = $tmp; + } + return $data; } -- cgit v1.2.3