Simplified null check
This commit is contained in:
@@ -37,10 +37,10 @@ class Apps extends BaseApi
|
||||
*/
|
||||
public static function post(array $parameters = [])
|
||||
{
|
||||
$name = !isset($_REQUEST['client_name']) ? '' : $_REQUEST['client_name'];
|
||||
$redirect = !isset($_REQUEST['redirect_uris']) ? '' : $_REQUEST['redirect_uris'];
|
||||
$scopes = !isset($_REQUEST['scopes']) ? '' : $_REQUEST['scopes'];
|
||||
$website = !isset($_REQUEST['website']) ? '' : $_REQUEST['website'];
|
||||
$name = $_REQUEST['client_name'] ?? '';
|
||||
$redirect = $_REQUEST['redirect_uris'] ?? '';
|
||||
$scopes = $_REQUEST['scopes'] ?? '';
|
||||
$website = $_REQUEST['website'] ?? '';
|
||||
|
||||
if (empty($name) || empty($redirect)) {
|
||||
DI::mstdnError()->UnprocessableEntity(DI::l10n()->t('Missing parameters'));
|
||||
|
||||
@@ -44,7 +44,7 @@ class Directory extends BaseApi
|
||||
{
|
||||
$offset = (int)!isset($_REQUEST['offset']) ? 0 : $_REQUEST['offset'];
|
||||
$limit = (int)!isset($_REQUEST['limit']) ? 40 : $_REQUEST['limit'];
|
||||
$order = !isset($_REQUEST['order']) ? 'active' : $_REQUEST['order'];
|
||||
$order = $_REQUEST['order'] ?? 'active';
|
||||
$local = (bool)!isset($_REQUEST['local']) ? false : ($_REQUEST['local'] == 'true');
|
||||
|
||||
Logger::info('directory', ['offset' => $offset, 'limit' => $limit, 'order' => $order, 'local' => $local]);
|
||||
|
||||
@@ -63,7 +63,7 @@ class Notifications extends BaseApi
|
||||
$limit = (int)!isset($_REQUEST['limit']) ? 20 : $_REQUEST['limit'];
|
||||
|
||||
// Array of types to exclude (follow, favourite, reblog, mention, poll, follow_request)
|
||||
$exclude_types = !isset($_REQUEST['exclude_types']) ? [] : $_REQUEST['exclude_types'];
|
||||
$exclude_types = $_REQUEST['exclude_types'] ?? [];
|
||||
|
||||
// Return only notifications received from this account
|
||||
$account_id = (int)!isset($_REQUEST['account_id']) ? 0 : $_REQUEST['account_id'];
|
||||
|
||||
Reference in New Issue
Block a user