fix user agent

This commit is contained in:
2018-12-02 19:52:01 +01:00
parent cc09e8002b
commit ef8e0c7359

View File

@@ -38,7 +38,11 @@ class Feed extends PhpObject
curl_setopt($oCurl, CURLOPT_URL, $sUrl); curl_setopt($oCurl, CURLOPT_URL, $sUrl);
curl_setopt($oCurl, CURLOPT_HEADER, false); curl_setopt($oCurl, CURLOPT_HEADER, false);
curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, true); curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($oCurl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); curl_setopt($oCurl, CURLOPT_USERAGENT, array_key_exists('HTTP_USER_AGENT', $_SERVER)?$_SERVER['HTTP_USER_AGENT']:'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0');
$fCookieJar = tempnam('/tmp','cookie');
curl_setopt($oCurl, CURLOPT_COOKIESESSION, true);
curl_setopt($oCurl, CURLOPT_COOKIEJAR, $fCookieJar);
curl_setopt($oCurl, CURLOPT_COOKIEFILE, $fCookieJar);
//curl_setopt($oCurl, CURLOPT_ENCODING, 'gzip'); //curl_setopt($oCurl, CURLOPT_ENCODING, 'gzip');
$sRssContent = curl_exec($oCurl); $sRssContent = curl_exec($oCurl);
curl_close($oCurl); curl_close($oCurl);