forked from GNUsocial/gnu-social
don't allow forwarding your own notice
This commit is contained in:
parent
985d6a0de4
commit
21757186e9
@ -72,6 +72,11 @@ class ForwardAction extends Action
|
|||||||
return false;
|
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);
|
$token = $this->trimmed('token-'.$id);
|
||||||
|
|
||||||
if (empty($token) || $token != common_session_token()) {
|
if (empty($token) || $token != common_session_token()) {
|
||||||
|
@ -540,7 +540,7 @@ class NoticeListItem extends Widget
|
|||||||
function showForwardForm()
|
function showForwardForm()
|
||||||
{
|
{
|
||||||
$user = common_current_user();
|
$user = common_current_user();
|
||||||
if ($user) {
|
if ($user && $user->id != $this->notice->profile_id) {
|
||||||
$profile = $user->getProfile();
|
$profile = $user->getProfile();
|
||||||
if ($profile->hasForwarded($this->notice->id)) {
|
if ($profile->hasForwarded($this->notice->id)) {
|
||||||
$this->out->text(_('Forwarded'));
|
$this->out->text(_('Forwarded'));
|
||||||
|
Loading…
Reference in New Issue
Block a user