]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Add in a check for proper format
authorZach Copley <zach@status.net>
Mon, 5 Oct 2009 20:25:34 +0000 (13:25 -0700)
committerZach Copley <zach@status.net>
Mon, 5 Oct 2009 20:25:34 +0000 (13:25 -0700)
actions/apifriendshipscreate.php
actions/apifriendshipsdestroy.php

index d691b5b4f85666714dd872929b5b643c29eb5673..969fc12820a3df734d580a1b4b6be51bb4179ba1 100644 (file)
@@ -101,6 +101,15 @@ class ApiFriendshipsCreateAction extends ApiAuthAction
             return;
         }
 
+        if (!in_array($this->format, array('xml', 'json'))) {
+            $this->clientError(
+                _('API method not found!'),
+                404,
+                $this->format
+            );
+            return;
+        }
+
         if (empty($this->other)) {
             $this->clientError(
                 _('Could not follow user: User not found.'),
index d97c5aa6db04a822d169a2caf28384c833505b63..ef864c4db84d721a9e5f372ba65a2d4480e4206e 100644 (file)
@@ -101,6 +101,15 @@ class ApiFriendshipsDestroyAction extends ApiAuthAction
             return;
         }
 
+        if (!in_array($this->format, array('xml', 'json'))) {
+            $this->clientError(
+                _('API method not found!'),
+                404,
+                $this->format
+            );
+            return;
+        }
+
         if (empty($this->other)) {
             $this->clientError(
                 _('Could not unfollow user: User not found.'),