Make it impossible to delete self-subscriptions via the API
This commit is contained in:
parent
5bad7040b1
commit
4081ed79b0
@ -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