]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
don't allow forwarding your own notice
authorEvan Prodromou <evan@status.net>
Tue, 8 Dec 2009 22:52:20 +0000 (17:52 -0500)
committerEvan Prodromou <evan@status.net>
Tue, 8 Dec 2009 22:52:20 +0000 (17:52 -0500)
actions/forward.php
lib/noticelist.php

index 867ed97d29b324e75a905653ad0fbecd9f86c573..194833fe0cf56a56f9a69039549178ca720d32e0 100644 (file)
@@ -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()) {
index b38860880de9f789330b57f737e0c7b9deba2fc6..d6ffc9ca9c9af67f229aec94c9a5afb7f2275344 100644 (file)
@@ -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'));