mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
XML Request에서 object 및 array child argument를 전송할 수 없는 문제 해결
This commit is contained in:
parent
d4e10dd338
commit
c2511530a7
3 changed files with 111 additions and 23 deletions
|
|
@ -219,7 +219,7 @@ class Context
|
|||
if($this->db_info->use_sitelock == 'Y')
|
||||
{
|
||||
if(is_array($this->db_info->sitelock_whitelist)) $whitelist = $this->db_info->sitelock_whitelist;
|
||||
|
||||
|
||||
if(!IpFilter::filter($whitelist))
|
||||
{
|
||||
$title = ($this->db_info->sitelock_title) ? $this->db_info->sitelock_title : 'Maintenance in progress...';
|
||||
|
|
@ -1252,19 +1252,75 @@ class Context
|
|||
$xml_obj = $oXml->parse();
|
||||
|
||||
$params = $xml_obj->methodcall->params;
|
||||
unset($params->node_name, $params->attrs);
|
||||
unset($params->node_name, $params->attrs, $params->body);
|
||||
|
||||
if(!count($params))
|
||||
if(!count(get_object_vars($params)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach($params as $key => $obj)
|
||||
foreach($params as $key => $val)
|
||||
{
|
||||
$this->set($key, $this->_filterRequestVar($key, $obj->body, 0), TRUE);
|
||||
$this->set($key, $this->_filterXmlVars($key, $val), TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter xml variables
|
||||
*
|
||||
* @param string $key Variable key
|
||||
* @param object $val Variable value
|
||||
* @return mixed filtered value
|
||||
*/
|
||||
function _filterXmlVars($key, $val)
|
||||
{
|
||||
if(is_array($val))
|
||||
{
|
||||
$stack = array();
|
||||
foreach($val as $k => $v)
|
||||
{
|
||||
$stack[$k] = $this->_filterXmlVars($k, $v);
|
||||
}
|
||||
|
||||
return $stack;
|
||||
}
|
||||
|
||||
$body = $this->_filterRequestVar($key, trim($val->body ? $val->body : ''), 0);
|
||||
if($body)
|
||||
{
|
||||
return $body;
|
||||
}
|
||||
|
||||
unset($val->node_name, $val->attrs, $val->body);
|
||||
if(!count(get_object_vars($val)))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
$stack = new stdClass();
|
||||
foreach($val as $k => $v)
|
||||
{
|
||||
$output = $this->_filterXmlVars($k, $v);
|
||||
if(is_object($v) && $v->attrs->type == 'array')
|
||||
{
|
||||
$output = array($output);
|
||||
}
|
||||
if($k == 'value' && (is_array($v) || $v->attrs->type == 'array'))
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
$stack->{$k} = $output;
|
||||
}
|
||||
|
||||
if(!count(get_object_vars($stack)))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return $stack;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter request variable
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue