]> git.mxchange.org Git - friendica.git/commitdiff
Use the $request variable
authorMichael <heluecht@pirati.ca>
Sun, 16 Jan 2022 07:35:20 +0000 (07:35 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 16 Jan 2022 07:35:20 +0000 (07:35 +0000)
src/Module/Api/Friendica/Group/Create.php
src/Module/Api/Friendica/Group/Show.php
src/Module/Api/Friendica/Notification/Seen.php
src/Module/Api/Friendica/Photo.php
src/Module/Api/Friendica/Photo/Create.php
src/Module/Api/Friendica/Photo/Update.php
src/Module/Api/Twitter/Account/UpdateProfileImage.php
src/Module/Api/Twitter/Friendships/Show.php
src/Module/Api/Twitter/Lists/Create.php
src/Module/Api/Twitter/Lists/Destroy.php
src/Module/Api/Twitter/Lists/Update.php

index be85146f4d4c34c450d571d51cf4fe5654b36a42..15394fec423289b4b7c896056eb8d8a178130bd9 100644 (file)
@@ -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'];
 
index 3ec2b762543118f7f56c11aea9a2eceee33f4edd..b2ce4ea0656ac82a7385bdfa8579ba8c940c4db9 100644 (file)
@@ -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) {
index e2933726247d9ffa1fed053ba46a5f63fb7ebe38..30637d78c11a9b0468938bfb8315bac04dc5ba08 100644 (file)
@@ -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()];
index 4334bafebed88bb8c79fcf24482021b0a75a4f19..6e5b02c4fd886353fcca111dd828cfab1a11ac79 100644 (file)
@@ -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)];
index 0455321d0834aa780f0e23871c3f43e7a51b9964..460bff40f93717122548f947277a13c673bbb738 100644 (file)
@@ -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
index b964ad0230cb51345f569792be767a72034795db..24c07be8e6eb66799db524514844c9166ff84b4b 100644 (file)
@@ -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
index 15ca6cf929b47cea9e40165aae16cee6c81523ad..422ed4416c91e5ced528b8f017b6e9c03a8793ca 100644 (file)
@@ -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();
        
index 6db48506a34f5459c38d47f00ea1335de3241be8..66605e72650822f47483f75787ebb256dcffa083 100644 (file)
@@ -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)) {
index 80071c30e245ffa2aa3ce6e8474e7c3d632e9baa..cbe150385520a5207244db022aa2612a77191dc4 100644 (file)
@@ -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');
index 06ca9a73dca89a8955365ac54fd111031cd6be3f..c0377e135b083fac811d292dd16aa2017027708d 100644 (file)
@@ -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) {
index d670c3a6d4f3a8672c07b424e83c0e59d2892cee..ba3886aaaf1778b885fd6c8fa9dc84db2991818f 100644 (file)
@@ -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) {