diff --git a/src/BaseModule.php b/src/BaseModule.php index a1f4c033c6..aa72249c73 100644 --- a/src/BaseModule.php +++ b/src/BaseModule.php @@ -164,6 +164,19 @@ abstract class BaseModule implements ICanHandleRequests { } + /** + * Module GET method to process submitted data + * + * Extend this method if the module is supposed to process GET requests. + * Doesn't display any content + * + * @param string[] $request The $_REQUEST content + * @return void + */ + protected function get(array $request = []) + { + } + /** * {@inheritDoc} */ @@ -221,7 +234,10 @@ abstract class BaseModule implements ICanHandleRequests case Router::PUT: $this->put($request); return $this->response->generate(); - } + case Router::GET: + $this->get($request); + break; + } $timestamp = microtime(true); // "rawContent" is especially meant for technical endpoints. diff --git a/src/Module/Api/Mastodon/Lists.php b/src/Module/Api/Mastodon/Lists.php index b2f3292d9e..2fe4e9df7f 100644 --- a/src/Module/Api/Mastodon/Lists.php +++ b/src/Module/Api/Mastodon/Lists.php @@ -99,7 +99,7 @@ class Lists extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - protected function rawContent(array $request = []) + protected function get(array $request = []) { $this->checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Lists/Accounts.php b/src/Module/Api/Mastodon/Lists/Accounts.php index a220301e7a..5d3798946c 100644 --- a/src/Module/Api/Mastodon/Lists/Accounts.php +++ b/src/Module/Api/Mastodon/Lists/Accounts.php @@ -53,7 +53,7 @@ class Accounts extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - protected function rawContent(array $request = []) + protected function get(array $request = []) { $this->checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Markers.php b/src/Module/Api/Mastodon/Markers.php index 11ae2e9324..5c9b6476a1 100644 --- a/src/Module/Api/Mastodon/Markers.php +++ b/src/Module/Api/Mastodon/Markers.php @@ -51,7 +51,7 @@ class Markers extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - protected function rawContent(array $request = []) + protected function get(array $request = []) { $this->checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Media.php b/src/Module/Api/Mastodon/Media.php index cc69d5a546..b15f1cc81c 100644 --- a/src/Module/Api/Mastodon/Media.php +++ b/src/Module/Api/Mastodon/Media.php @@ -116,7 +116,7 @@ class Media extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - protected function rawContent(array $request = []) + protected function get(array $request = []) { $this->checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/PushSubscription.php b/src/Module/Api/Mastodon/PushSubscription.php index a83263bb24..835a8273d5 100644 --- a/src/Module/Api/Mastodon/PushSubscription.php +++ b/src/Module/Api/Mastodon/PushSubscription.php @@ -133,7 +133,7 @@ class PushSubscription extends BaseApi $this->response->addJsonContent([]); } - protected function rawContent(array $request = []): void + protected function get(array $request = []): void { $this->checkAllowedScope(self::SCOPE_PUSH); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/ScheduledStatuses.php b/src/Module/Api/Mastodon/ScheduledStatuses.php index e63d81522d..3cb8568639 100644 --- a/src/Module/Api/Mastodon/ScheduledStatuses.php +++ b/src/Module/Api/Mastodon/ScheduledStatuses.php @@ -48,7 +48,7 @@ class ScheduledStatuses extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - protected function rawContent(array $request = []) + protected function get(array $request = []) { $this->checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Statuses.php b/src/Module/Api/Mastodon/Statuses.php index 2a3da0288a..8d0fcdd209 100644 --- a/src/Module/Api/Mastodon/Statuses.php +++ b/src/Module/Api/Mastodon/Statuses.php @@ -350,7 +350,7 @@ class Statuses extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - protected function rawContent(array $request = []) + protected function get(array $request = []) { $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Twitter/DirectMessages/Inbox.php b/src/Module/Api/Twitter/DirectMessages/Inbox.php index fbf5ac9096..fe017b16a6 100644 --- a/src/Module/Api/Twitter/DirectMessages/Inbox.php +++ b/src/Module/Api/Twitter/DirectMessages/Inbox.php @@ -18,7 +18,7 @@ use Friendica\Module\BaseApi; */ class Inbox extends DirectMessagesEndpoint { - protected function rawContent(array $request = []) + protected function get(array $request = []) { $this->checkAllowedScope(BaseApi::SCOPE_READ); $uid = BaseApi::getCurrentUserID();