사용자단 따옴표 수정
This commit is contained in:
@ -12,16 +12,16 @@ if (!defined('_GNUBOARD_')) exit;
|
||||
/////////////////////////////////////////
|
||||
|
||||
// return 값이 있으면 오류, 없으면 정상
|
||||
function send_trackback($tb_url, $url, $title, $blog_name, $excerpt)
|
||||
function send_trackback($tb_url, $url, $title, $blog_name, $excerpt)
|
||||
{
|
||||
/*
|
||||
// allow_url_fopen = Off 일 경우 트랙백 사용할 수 없었던 오류를 수정
|
||||
// allow_url_fopen = On 일 경우에만 사용 가능
|
||||
//주소가 유효한지 검사
|
||||
$p_fp = fopen($tb_url,"r");
|
||||
if($p_fp)
|
||||
if($p_fp)
|
||||
@fclose($p_fp);
|
||||
else
|
||||
else
|
||||
return "트랙백 URL이 존재하지 않습니다.";
|
||||
*/
|
||||
|
||||
@ -33,20 +33,20 @@ function send_trackback($tb_url, $url, $title, $blog_name, $excerpt)
|
||||
|
||||
//주소 처리
|
||||
$uinfo = parse_url($tb_url);
|
||||
if($uinfo[query]) $tmp_data .= "&".$uinfo[query];
|
||||
if(!$uinfo[port]) $uinfo[port] = "80";
|
||||
if($uinfo['query']) $tmp_data .= "&".$uinfo['query'];
|
||||
if(!$uinfo['port']) $uinfo['port'] = "80";
|
||||
|
||||
//최종 전송 자료
|
||||
$send_str = "POST ".$uinfo[path]." HTTP/1.1\r\n".
|
||||
"Host: ".$uinfo[host]."\r\n".
|
||||
"User-Agent: GNUBOARD\r\n".
|
||||
"Content-Type: application/x-www-form-urlencoded\r\n".
|
||||
"Content-length: ".strlen($tmp_data)."\r\n".
|
||||
"Connection: close\r\n\r\n".
|
||||
$send_str = 'POST '.$uinfo['path'].' HTTP/1.1\r\n'.
|
||||
'Host: '.$uinfo['host'].'\r\n'.
|
||||
'User-Agent: GNUBOARD\r\n'.
|
||||
'Content-Type: application/x-www-form-urlencoded\r\n'.
|
||||
'Content-length: ".strlen($tmp_data)."\r\n'.
|
||||
'Connection: close\r\n\r\n'.
|
||||
$tmp_data;
|
||||
$fp = @fsockopen($uinfo[host],$uinfo[port]);
|
||||
if(!$fp)
|
||||
return "트랙백 URL이 존재하지 않습니다.";
|
||||
$fp = @fsockopen($uinfo['host'],$uinfo['port']);
|
||||
if(!$fp)
|
||||
return '트랙백 URL이 존재하지 않습니다.';
|
||||
|
||||
//전송
|
||||
//$fp = fsockopen($uinfo[host],$uinfo[port]);
|
||||
@ -57,21 +57,21 @@ function send_trackback($tb_url, $url, $title, $blog_name, $excerpt)
|
||||
fclose($fp);
|
||||
|
||||
//트랙백 URL인지 확인
|
||||
if(!strstr($response,"<response>"))
|
||||
return "올바른 트랙백 URL이 아닙니다.";
|
||||
if(!strstr($response,'<response>'))
|
||||
return '올바른 트랙백 URL이 아닙니다.';
|
||||
|
||||
//XML 부분만 뽑음
|
||||
$response = strchr($response,"<?");
|
||||
$response = substr($response,0,strpos($response,"</response>"));
|
||||
$response = strchr($response,'<?');
|
||||
$response = substr($response,0,strpos($response,'</response>'));
|
||||
|
||||
//에러 검사
|
||||
if(strstr($response,"<error>0</error>"))
|
||||
return "";
|
||||
if(strstr($response,'<error>0</error>'))
|
||||
return '';
|
||||
else {
|
||||
$tb_error_str = strchr($response,"<message>");
|
||||
$tb_error_str = substr($tb_error_str,0,strpos($tb_error_str,"</message>"));
|
||||
$tb_error_str = str_replace("<message>","",$tb_error_str);
|
||||
return "트랙백 전송중 오류가 발생했습니다: $tb_error_str";
|
||||
$tb_error_str = strchr($response,'<message>');
|
||||
$tb_error_str = substr($tb_error_str,0,strpos($tb_error_str,'</message>'));
|
||||
$tb_error_str = str_replace('<message>','',$tb_error_str);
|
||||
return '트랙백 전송중 오류가 발생했습니다: '.$tb_error_str;
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user