]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Make it impossible to delete self-subscriptions via the API
authorZach Copley <zach@controlyourself.ca>
Tue, 15 Sep 2009 19:59:32 +0000 (12:59 -0700)
committerZach Copley <zach@controlyourself.ca>
Tue, 15 Sep 2009 20:01:12 +0000 (13:01 -0700)
actions/twitapifriendships.php

index f2ea46910ee92edbf0c0618b1e51e66787085e0a..eea8945c393402d7080bda3534f38116ffe9bc7b 100644 (file)
@@ -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;