Replaced $_REQUEST
This commit is contained in:
parent
344d514857
commit
dd8d49d9cf
|
@ -37,7 +37,7 @@ class Media extends BaseApi
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
||||||
Logger::info('Photo post', ['request' => $_REQUEST, 'files' => $_FILES]);
|
Logger::info('Photo post', ['request' => $request, 'files' => $_FILES]);
|
||||||
|
|
||||||
if (empty($_FILES['file'])) {
|
if (empty($_FILES['file'])) {
|
||||||
DI::mstdnError()->UnprocessableEntity();
|
DI::mstdnError()->UnprocessableEntity();
|
||||||
|
|
|
@ -84,7 +84,7 @@ abstract class DirectMessagesEndpoint extends BaseApi
|
||||||
$params['order'] = ['id'];
|
$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)) {
|
if (!empty($cid)) {
|
||||||
$cdata = Contact::getPublicAndUserContactID($cid, $uid);
|
$cdata = Contact::getPublicAndUserContactID($cid, $uid);
|
||||||
if (!empty($cdata['user'])) {
|
if (!empty($cdata['user'])) {
|
||||||
|
|
|
@ -41,27 +41,26 @@ class Tweets extends BaseApi
|
||||||
BaseApi::checkAllowedScope(BaseApi::SCOPE_READ);
|
BaseApi::checkAllowedScope(BaseApi::SCOPE_READ);
|
||||||
$uid = BaseApi::getCurrentUserID();
|
$uid = BaseApi::getCurrentUserID();
|
||||||
|
|
||||||
if (empty($_REQUEST['q'])) {
|
if (empty($request['q'])) {
|
||||||
throw new BadRequestException('q parameter is required.');
|
throw new BadRequestException('q parameter is required.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$searchTerm = trim(rawurldecode($_REQUEST['q']));
|
$searchTerm = trim(rawurldecode($request['q']));
|
||||||
|
|
||||||
$data['status'] = [];
|
$data['status'] = [];
|
||||||
|
|
||||||
$count = 15;
|
$count = 15;
|
||||||
|
|
||||||
$exclude_replies = !empty($_REQUEST['exclude_replies']);
|
$exclude_replies = !empty($request['exclude_replies']);
|
||||||
if (!empty($_REQUEST['rpp'])) {
|
if (!empty($request['rpp'])) {
|
||||||
$count = $_REQUEST['rpp'];
|
$count = $request['rpp'];
|
||||||
} elseif (!empty($_REQUEST['count'])) {
|
} elseif (!empty($request['count'])) {
|
||||||
$count = $_REQUEST['count'];
|
$count = $request['count'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$since_id = $_REQUEST['since_id'] ?? 0;
|
$since_id = $this->getRequestValue($request, 'since_id', 0, 0);
|
||||||
$max_id = $_REQUEST['max_id'] ?? 0;
|
$max_id = $this->getRequestValue($request, 'max_id', 0, 0);
|
||||||
$page = $_REQUEST['page'] ?? 1;
|
$page = $this->getRequestValue($request, 'page', 1, 1);
|
||||||
|
|
||||||
$include_entities = $this->getRequestValue($request, 'include_entities', false);
|
$include_entities = $this->getRequestValue($request, 'include_entities', false);
|
||||||
|
|
||||||
$start = max(0, ($page - 1) * $count);
|
$start = max(0, ($page - 1) * $count);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user