mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 03:01:43 +09:00
#17946293 : rss_reader 위젯의 rss_request() 함수의 잘못된 반환값을 수정하고, proc() 함수에서 연결에 실패하였을 때 적절한 오류 메시지를 반환하도록 수정. 그리고, 이에 맞게 각 lang 파일에 메시지 코드 추가.
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6142 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
f968bd65c0
commit
41f566f434
10 changed files with 33 additions and 15 deletions
|
|
@ -45,10 +45,10 @@
|
|||
|
||||
$oResponse = $oReqeust->sendRequest();
|
||||
if (PEAR::isError($oResponse)) {
|
||||
return new Object(-1, 'msg_fail_to_request_open');
|
||||
return;
|
||||
}
|
||||
$header = $oReqeust->getResponseHeader();
|
||||
if($header['location']) {
|
||||
if($header['location']) {
|
||||
return $this->rss_request(trim($header['location']));
|
||||
}
|
||||
else {
|
||||
|
|
@ -73,7 +73,7 @@
|
|||
|
||||
$buff = $this->rss_request($args->rss_url);
|
||||
|
||||
if(!$buff) return new Object(-1, 'msg_fail_to_request_open');
|
||||
if(!is_string($buff) or !$buff) return Context::getLang('msg_fail_to_request_open');
|
||||
|
||||
$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));
|
||||
|
|
@ -86,8 +86,8 @@
|
|||
$rss->link = $xml_doc->rss->channel->link->body;
|
||||
|
||||
$items = $xml_doc->rss->channel->item;
|
||||
|
||||
if(!$items) return;
|
||||
|
||||
if(!$items) return Context::getLang('msg_invalid_format');
|
||||
if($items && !is_array($items)) $items = array($items);
|
||||
|
||||
$rss_list = array();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue