X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Ftwitapifriendships.php;h=eea8945c393402d7080bda3534f38116ffe9bc7b;hb=affe00276a008038e8a8b37b3812215e382fe98e;hp=5fb55e9ffed488ddcd47ae6bfc08ff5ecb109e14;hpb=dd705ddaf751ee8132cdd52e47aeef259477912c;p=quix0rs-gnu-social.git diff --git a/actions/twitapifriendships.php b/actions/twitapifriendships.php index 5fb55e9ffe..eea8945c39 100644 --- a/actions/twitapifriendships.php +++ b/actions/twitapifriendships.php @@ -1,7 +1,7 @@ . */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -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;