mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 18:21:39 +09:00
4d0cfabfb7 exec_json() 요청시 POST로 처리되어 AJAX communication error가 발생되는 문제 수정
This commit is contained in:
parent
720570224c
commit
cbd66462c7
1 changed files with 16 additions and 11 deletions
|
|
@ -1137,26 +1137,31 @@ class Context
|
|||
}
|
||||
|
||||
// Check POST data
|
||||
if(self::$_instance->request_method == 'POST')
|
||||
if(self::$_instance->request_method === 'POST')
|
||||
{
|
||||
if(!isset($GLOBALS['HTTP_RAW_POST_DATA']))
|
||||
{
|
||||
$GLOBALS['HTTP_RAW_POST_DATA'] = file_get_contents("php://input");
|
||||
}
|
||||
|
||||
// JSON or XMLRPC
|
||||
if ($GLOBALS['HTTP_RAW_POST_DATA'] && !$_POST)
|
||||
// Check JSON
|
||||
foreach(array($_SERVER['HTTP_ACCEPT'], $_SERVER['HTTP_CONTENT_TYPE'], $_SERVER['CONTENT_TYPE']) as $header)
|
||||
{
|
||||
foreach(array($_SERVER['HTTP_ACCEPT'], $_SERVER['HTTP_CONTENT_TYPE'], $_SERVER['CONTENT_TYPE']) as $header)
|
||||
if(strpos($header, 'json') !== false)
|
||||
{
|
||||
if(strpos($header, 'json') !== false)
|
||||
{
|
||||
$json_request = true;
|
||||
break;
|
||||
}
|
||||
$is_json = true;
|
||||
break;
|
||||
}
|
||||
|
||||
self::$_instance->request_method = isset($json_request) ? 'JSON' : 'XMLRPC';
|
||||
}
|
||||
|
||||
// JSON or XMLRPC
|
||||
if (isset($is_json))
|
||||
{
|
||||
self::$_instance->request_method = 'JSON';
|
||||
}
|
||||
elseif ($GLOBALS['HTTP_RAW_POST_DATA'] && !$_POST)
|
||||
{
|
||||
self::$_instance->request_method = 'XMLRPC';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue