From: Evan Prodromou Date: Tue, 8 Dec 2009 22:52:20 +0000 (-0500) Subject: don't allow forwarding your own notice X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=21757186e9a7ffd2e3330fd4ef61ffeb2dc0229b;p=quix0rs-gnu-social.git don't allow forwarding your own notice --- diff --git a/actions/forward.php b/actions/forward.php index 867ed97d29..194833fe0c 100644 --- a/actions/forward.php +++ b/actions/forward.php @@ -72,6 +72,11 @@ class ForwardAction extends Action return false; } + if ($this->user->id == $this->notice->profile_id) { + $this->clientError(_("You can't forward your own notice.")); + return false; + } + $token = $this->trimmed('token-'.$id); if (empty($token) || $token != common_session_token()) { diff --git a/lib/noticelist.php b/lib/noticelist.php index b38860880d..d6ffc9ca9c 100644 --- a/lib/noticelist.php +++ b/lib/noticelist.php @@ -540,7 +540,7 @@ class NoticeListItem extends Widget function showForwardForm() { $user = common_current_user(); - if ($user) { + if ($user && $user->id != $this->notice->profile_id) { $profile = $user->getProfile(); if ($profile->hasForwarded($this->notice->id)) { $this->out->text(_('Forwarded'));