Simplified null check
This commit is contained in:
@@ -36,7 +36,7 @@ class Authorize extends BaseApi
|
||||
*/
|
||||
public static function rawContent(array $parameters = [])
|
||||
{
|
||||
$response_type = !isset($_REQUEST['response_type']) ? '' : $_REQUEST['response_type'];
|
||||
$response_type = $_REQUEST['response_type'] ?? '';
|
||||
if ($response_type != 'code') {
|
||||
Logger::warning('Wrong or missing response type', ['response_type' => $response_type]);
|
||||
DI::mstdnError()->RecordNotFound();
|
||||
|
||||
@@ -34,9 +34,9 @@ class Token extends BaseApi
|
||||
{
|
||||
public static function post(array $parameters = [])
|
||||
{
|
||||
$client_secret = !isset($_REQUEST['client_secret']) ? '' : $_REQUEST['client_secret'];
|
||||
$code = !isset($_REQUEST['code']) ? '' : $_REQUEST['code'];
|
||||
$grant_type = !isset($_REQUEST['grant_type']) ? '' : $_REQUEST['grant_type'];
|
||||
$client_secret = $_REQUEST['client_secret'] ?? '';
|
||||
$code = $_REQUEST['code'] ?? '';
|
||||
$grant_type = $_REQUEST['grant_type'] ?? '';
|
||||
|
||||
if ($grant_type != 'authorization_code') {
|
||||
Logger::warning('Unsupported or missing grant type', ['request' => $_REQUEST]);
|
||||
|
||||
Reference in New Issue
Block a user