mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
Use empty() instead of simple ! to check superglobals
This commit is contained in:
parent
146ff27801
commit
5d52df9c9a
1 changed files with 3 additions and 3 deletions
|
|
@ -1218,7 +1218,7 @@ class Context
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Set HTTP_RAW_POST_DATA for third-party apps that look for it.
|
// Set HTTP_RAW_POST_DATA for third-party apps that look for it.
|
||||||
if (!$_POST && !isset($GLOBALS['HTTP_RAW_POST_DATA']))
|
if (empty($_POST) && empty($_FILES) && !isset($GLOBALS['HTTP_RAW_POST_DATA']))
|
||||||
{
|
{
|
||||||
$GLOBALS['HTTP_RAW_POST_DATA'] = file_get_contents('php://input');
|
$GLOBALS['HTTP_RAW_POST_DATA'] = file_get_contents('php://input');
|
||||||
}
|
}
|
||||||
|
|
@ -1234,7 +1234,7 @@ class Context
|
||||||
}
|
}
|
||||||
|
|
||||||
// Decide whether it's JSON or XMLRPC by looking at the first character of the POST data.
|
// Decide whether it's JSON or XMLRPC by looking at the first character of the POST data.
|
||||||
if (!$_POST && !empty($GLOBALS['HTTP_RAW_POST_DATA']))
|
if (empty($_POST) && !empty($GLOBALS['HTTP_RAW_POST_DATA']))
|
||||||
{
|
{
|
||||||
self::$_instance->request_method = substr($GLOBALS['HTTP_RAW_POST_DATA'], 0, 1) === '<' ? 'XMLRPC' : 'JSON';
|
self::$_instance->request_method = substr($GLOBALS['HTTP_RAW_POST_DATA'], 0, 1) === '<' ? 'XMLRPC' : 'JSON';
|
||||||
return;
|
return;
|
||||||
|
|
@ -1262,7 +1262,7 @@ class Context
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set JSON and XMLRPC arguments.
|
// Set JSON and XMLRPC arguments.
|
||||||
if(isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'POST' && !$_POST && !empty($GLOBALS['HTTP_RAW_POST_DATA']))
|
if(isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'POST' && empty($_POST) && !empty($GLOBALS['HTTP_RAW_POST_DATA']))
|
||||||
{
|
{
|
||||||
$params = array();
|
$params = array();
|
||||||
$request_method = self::getRequestMethod();
|
$request_method = self::getRequestMethod();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue