diff --git a/src/Module/Api/Friendica/Group/Create.php b/src/Module/Api/Friendica/Group/Create.php index be85146f4d..15394fec42 100644 --- a/src/Module/Api/Friendica/Group/Create.php +++ b/src/Module/Api/Friendica/Group/Create.php @@ -37,7 +37,7 @@ class Create extends BaseApi $uid = BaseApi::getCurrentUserID(); // params - $name = $_REQUEST['name'] ?? ''; + $name = $request['name'] ?? ''; $json = json_decode($_POST['json'], true); $users = $json['user']; diff --git a/src/Module/Api/Friendica/Group/Show.php b/src/Module/Api/Friendica/Group/Show.php index 3ec2b76254..b2ce4ea065 100644 --- a/src/Module/Api/Friendica/Group/Show.php +++ b/src/Module/Api/Friendica/Group/Show.php @@ -39,7 +39,7 @@ class Show extends BaseApi $type = $this->parameters['extension'] ?? ''; // params - $gid = $_REQUEST['gid'] ?? 0; + $gid = $request['gid'] ?? 0; // get data of the specified group id or all groups if not specified if ($gid != 0) { diff --git a/src/Module/Api/Friendica/Notification/Seen.php b/src/Module/Api/Friendica/Notification/Seen.php index e293372624..30637d78c1 100644 --- a/src/Module/Api/Friendica/Notification/Seen.php +++ b/src/Module/Api/Friendica/Notification/Seen.php @@ -47,7 +47,7 @@ class Seen extends BaseApi throw new BadRequestException('Invalid argument count'); } - $id = intval($_REQUEST['id'] ?? 0); + $id = intval($request['id'] ?? 0); try { $Notify = DI::notify()->selectOneById($id); @@ -65,7 +65,7 @@ class Seen extends BaseApi if ($Notify->otype === Notification\ObjectType::ITEM) { $item = Post::selectFirstForUser($uid, [], ['id' => $Notify->iid, 'uid' => $uid]); 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 $ret = [DI::twitterStatus()->createFromUriId($item['uri-id'], $item['uid'], $include_entities)->toArray()]; diff --git a/src/Module/Api/Friendica/Photo.php b/src/Module/Api/Friendica/Photo.php index 4334bafebe..6e5b02c4fd 100644 --- a/src/Module/Api/Friendica/Photo.php +++ b/src/Module/Api/Friendica/Photo.php @@ -50,12 +50,12 @@ class Photo extends BaseApi $uid = BaseApi::getCurrentUserID(); $type = $this->parameters['extension'] ?? ''; - if (empty($_REQUEST['photo_id'])) { + if (empty($request['photo_id'])) { throw new HTTPException\BadRequestException('No photo id.'); } - $scale = (!empty($_REQUEST['scale']) ? intval($_REQUEST['scale']) : false); - $photo_id = $_REQUEST['photo_id']; + $scale = (!empty($request['scale']) ? intval($request['scale']) : false); + $photo_id = $request['photo_id']; // prepare json/xml output with data from database for the requested photo $data = ['photo' => $this->friendicaPhoto->createFromId($photo_id, $scale, $uid, $type)]; diff --git a/src/Module/Api/Friendica/Photo/Create.php b/src/Module/Api/Friendica/Photo/Create.php index 0455321d08..460bff40f9 100644 --- a/src/Module/Api/Friendica/Photo/Create.php +++ b/src/Module/Api/Friendica/Photo/Create.php @@ -55,12 +55,12 @@ class Create extends BaseApi $type = $this->parameters['extension'] ?? ''; // input params - $desc = $_REQUEST['desc'] ?? null; - $album = $_REQUEST['album'] ?? null; - $allow_cid = $_REQUEST['allow_cid'] ?? null; - $deny_cid = $_REQUEST['deny_cid' ] ?? null; - $allow_gid = $_REQUEST['allow_gid'] ?? null; - $deny_gid = $_REQUEST['deny_gid' ] ?? null; + $desc = $request['desc'] ?? null; + $album = $request['album'] ?? null; + $allow_cid = $request['allow_cid'] ?? null; + $deny_cid = $request['deny_cid' ] ?? null; + $allow_gid = $request['allow_gid'] ?? null; + $deny_gid = $request['deny_gid' ] ?? null; // do several checks on input parameters // we do not allow calls without album string diff --git a/src/Module/Api/Friendica/Photo/Update.php b/src/Module/Api/Friendica/Photo/Update.php index b964ad0230..24c07be8e6 100644 --- a/src/Module/Api/Friendica/Photo/Update.php +++ b/src/Module/Api/Friendica/Photo/Update.php @@ -55,14 +55,14 @@ class Update extends BaseApi $type = $this->parameters['extension'] ?? ''; // input params - $photo_id = $_REQUEST['photo_id'] ?? null; - $desc = $_REQUEST['desc'] ?? null; - $album = $_REQUEST['album'] ?? null; - $album_new = $_REQUEST['album_new'] ?? null; - $allow_cid = $_REQUEST['allow_cid'] ?? null; - $deny_cid = $_REQUEST['deny_cid' ] ?? null; - $allow_gid = $_REQUEST['allow_gid'] ?? null; - $deny_gid = $_REQUEST['deny_gid' ] ?? null; + $photo_id = $request['photo_id'] ?? null; + $desc = $request['desc'] ?? null; + $album = $request['album'] ?? null; + $album_new = $request['album_new'] ?? null; + $allow_cid = $request['allow_cid'] ?? null; + $deny_cid = $request['deny_cid' ] ?? null; + $allow_gid = $request['allow_gid'] ?? null; + $deny_gid = $request['deny_gid' ] ?? null; // do several checks on input parameters // we do not allow calls without album string diff --git a/src/Module/Api/Twitter/Account/UpdateProfileImage.php b/src/Module/Api/Twitter/Account/UpdateProfileImage.php index 15ca6cf929..422ed4416c 100644 --- a/src/Module/Api/Twitter/Account/UpdateProfileImage.php +++ b/src/Module/Api/Twitter/Account/UpdateProfileImage.php @@ -57,7 +57,7 @@ class UpdateProfileImage extends BaseApi } // output for client - $skip_status = $_REQUEST['skip_status'] ?? false; + $skip_status = $request['skip_status'] ?? false; $user_info = DI::twitterUser()->createFromUserId($uid, $skip_status)->toArray(); diff --git a/src/Module/Api/Twitter/Friendships/Show.php b/src/Module/Api/Twitter/Friendships/Show.php index 6db48506a3..66605e7265 100644 --- a/src/Module/Api/Twitter/Friendships/Show.php +++ b/src/Module/Api/Twitter/Friendships/Show.php @@ -38,9 +38,9 @@ class Show extends ContactEndpoint self::checkAllowedScope(self::SCOPE_READ); $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); if (empty($source)) { diff --git a/src/Module/Api/Twitter/Lists/Create.php b/src/Module/Api/Twitter/Lists/Create.php index 80071c30e2..cbe1503855 100644 --- a/src/Module/Api/Twitter/Lists/Create.php +++ b/src/Module/Api/Twitter/Lists/Create.php @@ -60,7 +60,7 @@ class Create extends BaseApi $uid = BaseApi::getCurrentUserID(); // params - $name = $_REQUEST['name'] ?? ''; + $name = $request['name'] ?? ''; if ($name == '') { throw new HTTPException\BadRequestException('group name not specified'); diff --git a/src/Module/Api/Twitter/Lists/Destroy.php b/src/Module/Api/Twitter/Lists/Destroy.php index 06ca9a73dc..c0377e135b 100644 --- a/src/Module/Api/Twitter/Lists/Destroy.php +++ b/src/Module/Api/Twitter/Lists/Destroy.php @@ -60,7 +60,7 @@ class Destroy extends BaseApi $uid = BaseApi::getCurrentUserID(); // params - $gid = $_REQUEST['list_id'] ?? 0; + $gid = $request['list_id'] ?? 0; // error if no gid specified if ($gid == 0) { diff --git a/src/Module/Api/Twitter/Lists/Update.php b/src/Module/Api/Twitter/Lists/Update.php index d670c3a6d4..ba3886aaaf 100644 --- a/src/Module/Api/Twitter/Lists/Update.php +++ b/src/Module/Api/Twitter/Lists/Update.php @@ -60,8 +60,8 @@ class Update extends BaseApi $uid = BaseApi::getCurrentUserID(); // params - $gid = $_REQUEST['list_id'] ?? 0; - $name = $_REQUEST['name'] ?? ''; + $gid = $request['list_id'] ?? 0; + $name = $request['name'] ?? ''; // error if no gid specified if ($gid == 0) {