]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/twitapifriendships.php
clean up username entered at login
[quix0rs-gnu-social.git] / actions / twitapifriendships.php
index ae15d171e7c95e0233b2f26a0bc5484f477934b8..3cc925c3690bcd2ef29c00961e70e93418b877fd 100644 (file)
@@ -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