View Single Post
pizzahut
Senior Member
Join Date: Oct 2004
Old 04-21-2018 , 14:22   Re: Player avatars broken again?
Reply With Quote #3

Quote:
Originally Posted by Phorce_Phed View Post
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($chCURLOPT_URL$url."/".$page);
    
curl_setopt($chCURLOPT_FOLLOWLOCATION1);
    
curl_setopt($chCURLOPT_HEADER0);
    
curl_setopt($chCURLOPT_RETURNTRANSFER1);
    
$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.

Last edited by pizzahut; 04-21-2018 at 14:50.
pizzahut is offline