Replaced $_REQUEST

This commit is contained in:
Michael 2022-01-16 17:03:18 +00:00
parent 344d514857
commit dd8d49d9cf
3 changed files with 12 additions and 13 deletions

View file

@ -37,7 +37,7 @@ class Media extends BaseApi
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
Logger::info('Photo post', ['request' => $_REQUEST, 'files' => $_FILES]);
Logger::info('Photo post', ['request' => $request, 'files' => $_FILES]);
if (empty($_FILES['file'])) {
DI::mstdnError()->UnprocessableEntity();

View file

@ -84,7 +84,7 @@ abstract class DirectMessagesEndpoint extends BaseApi
$params['order'] = ['id'];
}
$cid = BaseApi::getContactIDForSearchterm($request['screen_name'] ?? '', $request['profileurl'] ?? '', $_REQUEST['user_id'] ?? 0, 0);
$cid = BaseApi::getContactIDForSearchterm($request['screen_name'] ?? '', $request['profileurl'] ?? '', $request['user_id'] ?? 0, 0);
if (!empty($cid)) {
$cdata = Contact::getPublicAndUserContactID($cid, $uid);
if (!empty($cdata['user'])) {

View file

@ -41,27 +41,26 @@ class Tweets extends BaseApi
BaseApi::checkAllowedScope(BaseApi::SCOPE_READ);
$uid = BaseApi::getCurrentUserID();
if (empty($_REQUEST['q'])) {
if (empty($request['q'])) {
throw new BadRequestException('q parameter is required.');
}
$searchTerm = trim(rawurldecode($_REQUEST['q']));
$searchTerm = trim(rawurldecode($request['q']));
$data['status'] = [];
$count = 15;
$exclude_replies = !empty($_REQUEST['exclude_replies']);
if (!empty($_REQUEST['rpp'])) {
$count = $_REQUEST['rpp'];
} elseif (!empty($_REQUEST['count'])) {
$count = $_REQUEST['count'];
$exclude_replies = !empty($request['exclude_replies']);
if (!empty($request['rpp'])) {
$count = $request['rpp'];
} elseif (!empty($request['count'])) {
$count = $request['count'];
}
$since_id = $_REQUEST['since_id'] ?? 0;
$max_id = $_REQUEST['max_id'] ?? 0;
$page = $_REQUEST['page'] ?? 1;
$since_id = $this->getRequestValue($request, 'since_id', 0, 0);
$max_id = $this->getRequestValue($request, 'max_id', 0, 0);
$page = $this->getRequestValue($request, 'page', 1, 1);
$include_entities = $this->getRequestValue($request, 'include_entities', false);
$start = max(0, ($page - 1) * $count);