close the socket in discover_pingback_server_uri
git-svn-id: http://svn.automattic.com/wordpress/trunk@8052 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
06ec52753b
commit
f7f3005004
|
@ -1001,18 +1001,22 @@ function discover_pingback_server_uri($url, $timeout_bytes = 2048) {
|
|||
$pingback_server_url_len = $pingback_href_end - $pingback_href_start;
|
||||
$pingback_server_url = substr($contents, $pingback_href_start, $pingback_server_url_len);
|
||||
// We may find rel="pingback" but an incomplete pingback URL
|
||||
if ( $pingback_server_url_len > 0 ) // We got it!
|
||||
if ( $pingback_server_url_len > 0 ) { // We got it!
|
||||
fclose($fp);
|
||||
return $pingback_server_url;
|
||||
}
|
||||
}
|
||||
$byte_count += strlen($line);
|
||||
if ( $byte_count > $timeout_bytes ) {
|
||||
// It's no use going further, there probably isn't any pingback
|
||||
// server to find in this file. (Prevents loading large files.)
|
||||
fclose($fp);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// We didn't find anything.
|
||||
fclose($fp);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue