forked from GNUsocial/gnu-social
Make it impossible to delete self-subscriptions via the API
This commit is contained in:
parent
aeef78b6ca
commit
12221f735e
@ -99,6 +99,12 @@ class TwitapifriendshipsAction extends TwitterapiAction
|
|||||||
$other = $this->get_profile($id);
|
$other = $this->get_profile($id);
|
||||||
$user = $apidata['user']; // Alwyas the auth user
|
$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 = new Subscription();
|
||||||
$sub->subscriber = $user->id;
|
$sub->subscriber = $user->id;
|
||||||
$sub->subscribed = $other->id;
|
$sub->subscribed = $other->id;
|
||||||
|
Loading…
Reference in New Issue
Block a user