Code:
function file_get_contents2($url){
$url_parsed = parse_url($url);
$fd = fsockopen($url_parsed[host], 80);
$data = ''; $header = false;
$reques_url = (strlen($url_parsed[query]) > 0) ?
$url_parsed[path]."?".$url_parsed[query] : $url_parsed[path];
fputs($fd,"GET ".$reques_url." HTTP/1.0\r\n");
fputs($fd,"Host: ".$url_parsed[host]."\r\n");
fputs($fd,"Connection: close\r\n\r\n");
while($line = fgets($fd)) {
if($header) $data .= $line;
if(strlen($line) <= 2) $header = true;
}
fclose($fd);
return $data;
}
Just been having a problem with a news script I have been using, and when comparing some files in my install to the originals from the author's site I noticed the above code has somehow been inserted.
I have now removed it from my install with no obvious side effects so can anybody understand it and tell me what it was doing?