diff options
author | Andrew Dolgov <[email protected]> | 2018-12-21 17:50:16 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2018-12-21 17:50:16 +0300 |
commit | a5517fe857535163d5989778108fd9d7eb891707 (patch) | |
tree | 4a0a3ddd4b77a9b2b109a8c54d7f744f012eebb3 /include/functions.php | |
parent | 782eda45db6861a09fc42bad396c3cb28505b28f (diff) |
fetch_file_contents: decompress gzipped data
af_readability: remove utf8 preamble hack
Diffstat (limited to 'include/functions.php')
-rwxr-xr-x | include/functions.php | 17 |
1 files changed, 17 insertions, 0 deletions
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; } |