From: Zach Copley <zach@status.net>
Date: Mon, 5 Oct 2009 20:25:34 +0000 (-0700)
Subject: Add in a check for proper format
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=62d1475df1c85c63f6d0dc4628a912c7666c2d21;p=quix0rs-gnu-social.git

Add in a check for proper format
---

diff --git a/actions/apifriendshipscreate.php b/actions/apifriendshipscreate.php
index d691b5b4f8..969fc12820 100644
--- a/actions/apifriendshipscreate.php
+++ b/actions/apifriendshipscreate.php
@@ -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.'),
diff --git a/actions/apifriendshipsdestroy.php b/actions/apifriendshipsdestroy.php
index d97c5aa6db..ef864c4db8 100644
--- a/actions/apifriendshipsdestroy.php
+++ b/actions/apifriendshipsdestroy.php
@@ -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.'),