X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Ftwitapifriendships.php;h=3cc925c3690bcd2ef29c00961e70e93418b877fd;hb=adeb19f1f7a82b17cee85ade1ac06fcd48e0d4cb;hp=ae15d171e7c95e0233b2f26a0bc5484f477934b8;hpb=d57bc1b8e99a432d7f6425d0c8836a3c4928581a;p=quix0rs-gnu-social.git diff --git a/actions/twitapifriendships.php b/actions/twitapifriendships.php index ae15d171e7..3cc925c369 100644 --- a/actions/twitapifriendships.php +++ b/actions/twitapifriendships.php @@ -40,6 +40,11 @@ class TwitapifriendshipsAction extends TwitterapiAction { function create($args, $apidata) { parent::handle($args); + if ($_SERVER['REQUEST_METHOD'] != 'POST') { + $this->client_error(_('This method requires a POST.'), 400, $apidata['content-type']); + exit(); + } + $id = $apidata['api_arg']; $other = $this->get_user($id); @@ -98,6 +103,12 @@ class TwitapifriendshipsAction extends TwitterapiAction { function destroy($args, $apidata) { parent::handle($args); + + if (!in_array($_SERVER['REQUEST_METHOD'], array('POST', 'DELETE'))) { + $this->client_error(_('This method requires a POST or DELETE.'), 400, $apidata['content-type']); + exit(); + } + $id = $apidata['api_arg']; # We can't subscribe to a remote person, but we can unsub