Make it impossible to delete self-subscriptions via the API

This commit is contained in:
Zach Copley 2009-09-15 12:59:32 -07:00
parent a9cf185e69
commit 80ba0603c6
1 changed files with 6 additions and 0 deletions

View 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;