]> git.mxchange.org Git - friendica.git/commitdiff
Improved request value handling
authorMichael <heluecht@pirati.ca>
Sun, 16 Jan 2022 17:30:23 +0000 (17:30 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 16 Jan 2022 17:30:23 +0000 (17:30 +0000)
src/Module/Api/Twitter/Search/Tweets.php

index 0aad5a43476a61769c1e23ac1d5dfda004108f14..0e0b2802e23fed707f71f09889c69e78274c1e05 100644 (file)
@@ -49,19 +49,13 @@ class Tweets extends BaseApi
 
                $data['status'] = [];
 
-               $count = 15;
-
-               $exclude_replies = !empty($request['exclude_replies']);
-               if (!empty($request['rpp'])) {
-                       $count = $request['rpp'];
-               } elseif (!empty($request['count'])) {
-                       $count = $request['count'];
-               }
-
+               $count            = $this->getRequestValue($request, 'count', 15);
+               $count            = $this->getRequestValue($request, 'rpp', $count);
                $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);
+               $exclude_replies  = $this->getRequestValue($request, 'exclude_replies', false);
 
                $start = max(0, ($page - 1) * $count);