mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
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:
parent
5ef606d850
commit
8aaf1858e2
1 changed files with 8 additions and 10 deletions
|
|
@ -35,22 +35,20 @@
|
|||
|
||||
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->setMethod('GET');
|
||||
|
||||
$user = $URL_parsed["user"];
|
||||
$pass = $URL_parsed["pass"];
|
||||
$user = $URL_parsed["user"];
|
||||
$pass = $URL_parsed["pass"];
|
||||
|
||||
if($user)
|
||||
$oReqeust->setBasicAuth($user, $pass);
|
||||
if($user) $oReqeust->setBasicAuth($user, $pass);
|
||||
|
||||
$oResponse = $oReqeust->sendRequest();
|
||||
if (PEAR::isError($oResponse))
|
||||
{
|
||||
debugPrint("error");
|
||||
return new Object(-1, 'msg_fail_to_request_open');
|
||||
}
|
||||
if (PEAR::isError($oResponse)) {
|
||||
debugPrint("error");
|
||||
return new Object(-1, 'msg_fail_to_request_open');
|
||||
}
|
||||
$buff = $oReqeust->getResponseBody();
|
||||
$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));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue