Use the $request variable
This commit is contained in:
parent
8ff2cc3976
commit
f11bf08a7b
|
@ -37,7 +37,7 @@ class Create extends BaseApi
|
||||||
$uid = BaseApi::getCurrentUserID();
|
$uid = BaseApi::getCurrentUserID();
|
||||||
|
|
||||||
// params
|
// params
|
||||||
$name = $_REQUEST['name'] ?? '';
|
$name = $request['name'] ?? '';
|
||||||
$json = json_decode($_POST['json'], true);
|
$json = json_decode($_POST['json'], true);
|
||||||
$users = $json['user'];
|
$users = $json['user'];
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ class Show extends BaseApi
|
||||||
$type = $this->parameters['extension'] ?? '';
|
$type = $this->parameters['extension'] ?? '';
|
||||||
|
|
||||||
// params
|
// params
|
||||||
$gid = $_REQUEST['gid'] ?? 0;
|
$gid = $request['gid'] ?? 0;
|
||||||
|
|
||||||
// get data of the specified group id or all groups if not specified
|
// get data of the specified group id or all groups if not specified
|
||||||
if ($gid != 0) {
|
if ($gid != 0) {
|
||||||
|
|
|
@ -47,7 +47,7 @@ class Seen extends BaseApi
|
||||||
throw new BadRequestException('Invalid argument count');
|
throw new BadRequestException('Invalid argument count');
|
||||||
}
|
}
|
||||||
|
|
||||||
$id = intval($_REQUEST['id'] ?? 0);
|
$id = intval($request['id'] ?? 0);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$Notify = DI::notify()->selectOneById($id);
|
$Notify = DI::notify()->selectOneById($id);
|
||||||
|
@ -65,7 +65,7 @@ class Seen extends BaseApi
|
||||||
if ($Notify->otype === Notification\ObjectType::ITEM) {
|
if ($Notify->otype === Notification\ObjectType::ITEM) {
|
||||||
$item = Post::selectFirstForUser($uid, [], ['id' => $Notify->iid, 'uid' => $uid]);
|
$item = Post::selectFirstForUser($uid, [], ['id' => $Notify->iid, 'uid' => $uid]);
|
||||||
if (DBA::isResult($item)) {
|
if (DBA::isResult($item)) {
|
||||||
$include_entities = strtolower(($_REQUEST['include_entities'] ?? 'false') == 'true');
|
$include_entities = strtolower(($request['include_entities'] ?? 'false') == 'true');
|
||||||
|
|
||||||
// we found the item, return it to the user
|
// we found the item, return it to the user
|
||||||
$ret = [DI::twitterStatus()->createFromUriId($item['uri-id'], $item['uid'], $include_entities)->toArray()];
|
$ret = [DI::twitterStatus()->createFromUriId($item['uri-id'], $item['uid'], $include_entities)->toArray()];
|
||||||
|
|
|
@ -50,12 +50,12 @@ class Photo extends BaseApi
|
||||||
$uid = BaseApi::getCurrentUserID();
|
$uid = BaseApi::getCurrentUserID();
|
||||||
$type = $this->parameters['extension'] ?? '';
|
$type = $this->parameters['extension'] ?? '';
|
||||||
|
|
||||||
if (empty($_REQUEST['photo_id'])) {
|
if (empty($request['photo_id'])) {
|
||||||
throw new HTTPException\BadRequestException('No photo id.');
|
throw new HTTPException\BadRequestException('No photo id.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$scale = (!empty($_REQUEST['scale']) ? intval($_REQUEST['scale']) : false);
|
$scale = (!empty($request['scale']) ? intval($request['scale']) : false);
|
||||||
$photo_id = $_REQUEST['photo_id'];
|
$photo_id = $request['photo_id'];
|
||||||
|
|
||||||
// prepare json/xml output with data from database for the requested photo
|
// prepare json/xml output with data from database for the requested photo
|
||||||
$data = ['photo' => $this->friendicaPhoto->createFromId($photo_id, $scale, $uid, $type)];
|
$data = ['photo' => $this->friendicaPhoto->createFromId($photo_id, $scale, $uid, $type)];
|
||||||
|
|
|
@ -55,12 +55,12 @@ class Create extends BaseApi
|
||||||
$type = $this->parameters['extension'] ?? '';
|
$type = $this->parameters['extension'] ?? '';
|
||||||
|
|
||||||
// input params
|
// input params
|
||||||
$desc = $_REQUEST['desc'] ?? null;
|
$desc = $request['desc'] ?? null;
|
||||||
$album = $_REQUEST['album'] ?? null;
|
$album = $request['album'] ?? null;
|
||||||
$allow_cid = $_REQUEST['allow_cid'] ?? null;
|
$allow_cid = $request['allow_cid'] ?? null;
|
||||||
$deny_cid = $_REQUEST['deny_cid' ] ?? null;
|
$deny_cid = $request['deny_cid' ] ?? null;
|
||||||
$allow_gid = $_REQUEST['allow_gid'] ?? null;
|
$allow_gid = $request['allow_gid'] ?? null;
|
||||||
$deny_gid = $_REQUEST['deny_gid' ] ?? null;
|
$deny_gid = $request['deny_gid' ] ?? null;
|
||||||
|
|
||||||
// do several checks on input parameters
|
// do several checks on input parameters
|
||||||
// we do not allow calls without album string
|
// we do not allow calls without album string
|
||||||
|
|
|
@ -55,14 +55,14 @@ class Update extends BaseApi
|
||||||
$type = $this->parameters['extension'] ?? '';
|
$type = $this->parameters['extension'] ?? '';
|
||||||
|
|
||||||
// input params
|
// input params
|
||||||
$photo_id = $_REQUEST['photo_id'] ?? null;
|
$photo_id = $request['photo_id'] ?? null;
|
||||||
$desc = $_REQUEST['desc'] ?? null;
|
$desc = $request['desc'] ?? null;
|
||||||
$album = $_REQUEST['album'] ?? null;
|
$album = $request['album'] ?? null;
|
||||||
$album_new = $_REQUEST['album_new'] ?? null;
|
$album_new = $request['album_new'] ?? null;
|
||||||
$allow_cid = $_REQUEST['allow_cid'] ?? null;
|
$allow_cid = $request['allow_cid'] ?? null;
|
||||||
$deny_cid = $_REQUEST['deny_cid' ] ?? null;
|
$deny_cid = $request['deny_cid' ] ?? null;
|
||||||
$allow_gid = $_REQUEST['allow_gid'] ?? null;
|
$allow_gid = $request['allow_gid'] ?? null;
|
||||||
$deny_gid = $_REQUEST['deny_gid' ] ?? null;
|
$deny_gid = $request['deny_gid' ] ?? null;
|
||||||
|
|
||||||
// do several checks on input parameters
|
// do several checks on input parameters
|
||||||
// we do not allow calls without album string
|
// we do not allow calls without album string
|
||||||
|
|
|
@ -57,7 +57,7 @@ class UpdateProfileImage extends BaseApi
|
||||||
}
|
}
|
||||||
|
|
||||||
// output for client
|
// output for client
|
||||||
$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();
|
||||||
|
|
||||||
|
|
|
@ -38,9 +38,9 @@ class Show extends ContactEndpoint
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = BaseApi::getCurrentUserID();
|
$uid = BaseApi::getCurrentUserID();
|
||||||
|
|
||||||
$source_cid = BaseApi::getContactIDForSearchterm($_REQUEST['source_screen_name'] ?? '', '', $_REQUEST['source_id'] ?? 0, $uid);
|
$source_cid = BaseApi::getContactIDForSearchterm($request['source_screen_name'] ?? '', '', $request['source_id'] ?? 0, $uid);
|
||||||
|
|
||||||
$target_cid = BaseApi::getContactIDForSearchterm($_REQUEST['target_screen_name'] ?? '', '', $_REQUEST['target_id'] ?? 0, $uid);
|
$target_cid = BaseApi::getContactIDForSearchterm($request['target_screen_name'] ?? '', '', $request['target_id'] ?? 0, $uid);
|
||||||
|
|
||||||
$source = Contact::getById($source_cid);
|
$source = Contact::getById($source_cid);
|
||||||
if (empty($source)) {
|
if (empty($source)) {
|
||||||
|
|
|
@ -60,7 +60,7 @@ class Create extends BaseApi
|
||||||
$uid = BaseApi::getCurrentUserID();
|
$uid = BaseApi::getCurrentUserID();
|
||||||
|
|
||||||
// params
|
// params
|
||||||
$name = $_REQUEST['name'] ?? '';
|
$name = $request['name'] ?? '';
|
||||||
|
|
||||||
if ($name == '') {
|
if ($name == '') {
|
||||||
throw new HTTPException\BadRequestException('group name not specified');
|
throw new HTTPException\BadRequestException('group name not specified');
|
||||||
|
|
|
@ -60,7 +60,7 @@ class Destroy extends BaseApi
|
||||||
$uid = BaseApi::getCurrentUserID();
|
$uid = BaseApi::getCurrentUserID();
|
||||||
|
|
||||||
// params
|
// params
|
||||||
$gid = $_REQUEST['list_id'] ?? 0;
|
$gid = $request['list_id'] ?? 0;
|
||||||
|
|
||||||
// error if no gid specified
|
// error if no gid specified
|
||||||
if ($gid == 0) {
|
if ($gid == 0) {
|
||||||
|
|
|
@ -60,8 +60,8 @@ class Update extends BaseApi
|
||||||
$uid = BaseApi::getCurrentUserID();
|
$uid = BaseApi::getCurrentUserID();
|
||||||
|
|
||||||
// params
|
// params
|
||||||
$gid = $_REQUEST['list_id'] ?? 0;
|
$gid = $request['list_id'] ?? 0;
|
||||||
$name = $_REQUEST['name'] ?? '';
|
$name = $request['name'] ?? '';
|
||||||
|
|
||||||
// error if no gid specified
|
// error if no gid specified
|
||||||
if ($gid == 0) {
|
if ($gid == 0) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user