Remove unneeded "unset"

This commit is contained in:
Michael 2021-11-24 21:30:11 +00:00
parent c9b14b260f
commit 513a745d07

View file

@ -706,12 +706,6 @@ function api_account_verify_credentials($type)
BaseApi::checkAllowedScope(BaseApi::SCOPE_READ); BaseApi::checkAllowedScope(BaseApi::SCOPE_READ);
$uid = BaseApi::getCurrentUserID(); $uid = BaseApi::getCurrentUserID();
unset($_REQUEST['user_id']);
unset($_GET['user_id']);
unset($_REQUEST['screen_name']);
unset($_GET['screen_name']);
$skip_status = $_REQUEST['skip_status'] ?? false; $skip_status = $_REQUEST['skip_status'] ?? false;
$user_info = DI::twitterUser()->createFromUserId($uid, $skip_status)->toArray(); $user_info = DI::twitterUser()->createFromUserId($uid, $skip_status)->toArray();
@ -1302,12 +1296,6 @@ function api_statuses_home_timeline($type)
BaseApi::checkAllowedScope(BaseApi::SCOPE_READ); BaseApi::checkAllowedScope(BaseApi::SCOPE_READ);
$uid = BaseApi::getCurrentUserID(); $uid = BaseApi::getCurrentUserID();
unset($_REQUEST['user_id']);
unset($_GET['user_id']);
unset($_REQUEST['screen_name']);
unset($_GET['screen_name']);
// get last network messages // get last network messages
// params // params
@ -1781,12 +1769,6 @@ function api_statuses_mentions($type)
BaseApi::checkAllowedScope(BaseApi::SCOPE_READ); BaseApi::checkAllowedScope(BaseApi::SCOPE_READ);
$uid = BaseApi::getCurrentUserID(); $uid = BaseApi::getCurrentUserID();
unset($_REQUEST['user_id']);
unset($_GET['user_id']);
unset($_REQUEST['screen_name']);
unset($_GET['screen_name']);
// get last network messages // get last network messages
// params // params
@ -2101,12 +2083,6 @@ function api_lists_statuses($type)
BaseApi::checkAllowedScope(BaseApi::SCOPE_READ); BaseApi::checkAllowedScope(BaseApi::SCOPE_READ);
$uid = BaseApi::getCurrentUserID(); $uid = BaseApi::getCurrentUserID();
unset($_REQUEST['user_id']);
unset($_GET['user_id']);
unset($_REQUEST['screen_name']);
unset($_GET['screen_name']);
if (empty($_REQUEST['list_id'])) { if (empty($_REQUEST['list_id'])) {
throw new BadRequestException('list_id not specified'); throw new BadRequestException('list_id not specified');
} }
@ -2557,13 +2533,6 @@ function api_direct_messages_box($type, $box, $verbose)
$user_id = $_REQUEST['user_id'] ?? ''; $user_id = $_REQUEST['user_id'] ?? '';
$screen_name = $_REQUEST['screen_name'] ?? ''; $screen_name = $_REQUEST['screen_name'] ?? '';
// caller user info
unset($_REQUEST['user_id']);
unset($_GET['user_id']);
unset($_REQUEST['screen_name']);
unset($_GET['screen_name']);
$user_info = DI::twitterUser()->createFromUserId($uid, true)->toArray(); $user_info = DI::twitterUser()->createFromUserId($uid, true)->toArray();
$profile_url = $user_info["url"]; $profile_url = $user_info["url"];