Quote:
Originally Posted by Phorce_Phed
Does anyone have a drop-in fix for this?
|
This quick fix by Master works, though I later found out that https is possible using fsockopen as well. Also, there is no error checking done in the quick fix.
So you can use this, but it's probably better to continue using fsockopen instead, just with SSL as described in the docu linked above.
As mentioned, I'm not running hlstatsx myself atm, so can't do any testing.
You can comment out the original function using
/* and
*/ .
PHP Code:
function fetchpage ($page)
{
$url = "https://steamcommunity.com";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url."/".$page);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$html_content = curl_exec($ch);
curl_close($ch);
return $html_content;
}
Looking at the code,
."/" is probably redundant. I think $page usually starts with a slash already, though not sure if this is always the case.