summaryrefslogtreecommitdiff
path: root/actions/twitapifriendships.php
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 13:01:56 -0700
commit12221f735eaf8a78b8a88841e38d9c7161afeb3c (patch)
treeb0af195d30daad3bdb966f86e03591a597a39d64 /actions/twitapifriendships.php
parentaeef78b6ca9473f464bcd22cb9a56be373bdc845 (diff)
Make it impossible to delete self-subscriptions via the API
Diffstat (limited to 'actions/twitapifriendships.php')
-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;