metaWeblog API중 최신글 못불러오는 버그 수정

CDATA 타입 추가 및 XML description 부분 CDATA로 처리.
This commit is contained in:
upgle 2014-04-19 22:19:36 +05:45
parent b0b6ef993b
commit 8b2ed49d10
2 changed files with 6 additions and 2 deletions

View file

@ -487,7 +487,7 @@ if($called_position == 'before_module_proc')
$post = new stdClass();
$post->categories = array();
$post->dateCreated = date("Ymd", $oDocument->getRegdateTime()) . 'T' . date("H:i:s", $oDocument->getRegdateTime());
$post->description = htmlspecialchars($oEditorController->transComponent($oDocument->getContent(false, false, true, false)), ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
$post->description = sprintf('<![CDATA[%s]]>',$oEditorController->transComponent($oDocument->getContent(false, false, true, false)));
$post->link = $post->permaLink = getFullUrl('', 'document_srl', $oDocument->document_srl);
$post->postid = $oDocument->document_srl;
$post->title = htmlspecialchars($oDocument->get('title'), ENT_COMPAT | ENT_HTML401, 'UTF-8', false);

View file

@ -31,7 +31,11 @@ function getXmlRpcResponse($params)
// Encoding
function _getEncodedVal($val, $is_sub_set = false)
{
if(is_int($val))
if(preg_match('/^\<\!\[CDATA\[/',$val))
{
$buff = sprintf("<value>%s</value>", $val);
}
elseif(is_int($val))
{
$buff = sprintf("<value><i4>%d</i4></value>", $val);
}