]> git.mxchange.org Git - friendica.git/commitdiff
Replaced $_REQUEST
authorMichael <heluecht@pirati.ca>
Sun, 16 Jan 2022 17:03:18 +0000 (17:03 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 16 Jan 2022 17:03:18 +0000 (17:03 +0000)
src/Module/Api/Mastodon/Media.php
src/Module/Api/Twitter/DirectMessagesEndpoint.php
src/Module/Api/Twitter/Search/Tweets.php

index d6fcba3e4108e386f99a1967c6bd475b364c2800..1253026fdd07f3be03a857b605ba5c1e36915854 100644 (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();
index c0c271dd765dd56d0abc4883ed991c765633e45f..28b867889f600a08bebdd17e9cdf45521cb48a03 100644 (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'])) {
index 0d6b5c230834b022aaf15d88cfe4dec242a0d9bc..0aad5a43476a61769c1e23ac1d5dfda004108f14 100644 (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);