summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZach Copley <zach@controlyourself.ca>2009-09-15 12:59:32 -0700
committerZach Copley <zach@controlyourself.ca>2009-09-15 12:59:32 -0700
commit80ba0603c65e1f2365f019128b656a042a2b82d0 (patch)
tree9b0c7b15fc592bb78e5ec51306afe0dd1d18d7c9
parenta9cf185e692fdc9dea2a9b127826ea8e0f9f1021 (diff)
Make it impossible to delete self-subscriptions via the API
-rw-r--r--actions/twitapifriendships.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/actions/twitapifriendships.php b/actions/twitapifriendships.php
index f2ea46910..eea8945c3 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;