This commit is contained in:
logmanoriginal 2016-09-17 20:20:05 +02:00
commit ce92edb0ba
2 changed files with 24 additions and 1 deletions

View file

@ -54,7 +54,7 @@ if(!extension_loaded('openssl'))
// FIXME : beta test UA spoofing, please report any blacklisting by PHP-fopen-unfriendly websites
ini_set('user_agent', 'Mozilla/5.0(X11; Linux x86_64; rv:30.0)
Gecko/20121202 Firefox/30.0(rss-bridge/0.1;
+https://github.com/sebsauvage/rss-bridge)');
+https://github.com/RSS-Bridge/rss-bridge)');
// default whitelist
$whitelist_file = './whitelist.txt';

View file

@ -364,6 +364,29 @@ abstract class BridgeAbstract implements BridgeInterface {
if($content === false)
$this->debugMessage('Cant\'t download ' . $url);
// handle compressed data
foreach($http_response_header as $header){
if(stristr($header, 'content-encoding')){
switch(true){
case stristr($header, 'gzip'):
$content = gzinflate( substr($content,10,-8));
break;
case stristr($header, 'compress'):
//TODO
case stristr($header, 'deflate'):
//TODO
case stristr($header, 'brotli'):
//TODO
returnServerError($header . '=> Not implemented yet');
break;
case stristr($header, 'identity'):
break;
default:
returnServerError($header . '=> Unknown compression');
}
}
}
return $content;
}