From: Zach Copley Date: Tue, 15 Sep 2009 19:59:32 +0000 (-0700) Subject: Make it impossible to delete self-subscriptions via the API X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=12221f735eaf8a78b8a88841e38d9c7161afeb3c;p=quix0rs-gnu-social.git Make it impossible to delete self-subscriptions via the API --- diff --git a/actions/twitapifriendships.php b/actions/twitapifriendships.php index f2ea46910e..eea8945c39 100644 --- a/actions/twitapifriendships.php +++ b/actions/twitapifriendships.php @@ -99,6 +99,12 @@ class TwitapifriendshipsAction extends TwitterapiAction $other = $this->get_profile($id); $user = $apidata['user']; // Alwyas the auth user + if ($user->id == $other->id) { + $this->clientError(_("You cannot unfollow yourself!"), + 403, $apidata['content-type']); + return; + } + $sub = new Subscription(); $sub->subscriber = $user->id; $sub->subscribed = $other->id;