rss_reader위젯이 PEAR 사용부에서 url이 아닌 path가 잘못 넘어가던 부분 수정하여 동작하도록 변경

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3814 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2008-02-26 01:28:29 +00:00
parent 5ef606d850
commit 8aaf1858e2

View file

@ -35,22 +35,20 @@
if ($URL_parsed["query"] != "") $path .= "?".$URL_parsed["query"]; if ($URL_parsed["query"] != "") $path .= "?".$URL_parsed["query"];
$oReqeust = new HTTP_Request($path); $oReqeust = new HTTP_Request($args->rss_url);
$oReqeust->addHeader('Content-Type', 'application/xml'); $oReqeust->addHeader('Content-Type', 'application/xml');
$oReqeust->setMethod('GET'); $oReqeust->setMethod('GET');
$user = $URL_parsed["user"]; $user = $URL_parsed["user"];
$pass = $URL_parsed["pass"]; $pass = $URL_parsed["pass"];
if($user) if($user) $oReqeust->setBasicAuth($user, $pass);
$oReqeust->setBasicAuth($user, $pass);
$oResponse = $oReqeust->sendRequest(); $oResponse = $oReqeust->sendRequest();
if (PEAR::isError($oResponse)) if (PEAR::isError($oResponse)) {
{ debugPrint("error");
debugPrint("error"); return new Object(-1, 'msg_fail_to_request_open');
return new Object(-1, 'msg_fail_to_request_open'); }
}
$buff = $oReqeust->getResponseBody(); $buff = $oReqeust->getResponseBody();
$encoding = preg_match("/<\?xml.*encoding=\"(.+)\".*\?>/i", $buff, $matches); $encoding = preg_match("/<\?xml.*encoding=\"(.+)\".*\?>/i", $buff, $matches);
if($encoding && !preg_match("/UTF-8/i", $matches[1])) $buff = trim(iconv($matches[1]=="ks_c_5601-1987"?"EUC-KR":$matches[1], "UTF-8", $buff)); if($encoding && !preg_match("/UTF-8/i", $matches[1])) $buff = trim(iconv($matches[1]=="ks_c_5601-1987"?"EUC-KR":$matches[1], "UTF-8", $buff));