Don't show errors if we can't fsockopen a server.

git-svn-id: http://svn.automattic.com/wordpress/trunk@1926 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2004-12-09 00:25:07 +00:00
parent c37fc847ff
commit 576846ba19
1 changed files with 2 additions and 2 deletions

View File

@ -817,7 +817,7 @@ function do_enclose( $content, $post_ID ) {
$headers = "HEAD $file HTTP/1.1\r\nHOST: $host\r\n\r\n"; $headers = "HEAD $file HTTP/1.1\r\nHOST: $host\r\n\r\n";
$port = 80; $port = 80;
$timeout = 3; $timeout = 3;
$fp = fsockopen($host, $port, $err_num, $err_msg, $timeout); $fp = @fsockopen($host, $port, $err_num, $err_msg, $timeout);
if( $fp ) { if( $fp ) {
fputs($fp, $headers ); fputs($fp, $headers );
$response = ''; $response = '';
@ -945,7 +945,7 @@ function discover_pingback_server_uri($url, $timeout_bytes = 2048) {
$port = (isset($port)) ? $port : 80; $port = (isset($port)) ? $port : 80;
// Try to connect to the server at $host // Try to connect to the server at $host
$fp = fsockopen($host, $port, $errno, $errstr, 3); $fp = @fsockopen($host, $port, $errno, $errstr, 2);
if (!$fp) { if (!$fp) {
// Couldn't open a connection to $host; // Couldn't open a connection to $host;
return false; return false;