X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fshownotice.php;h=77ba2ce9fda913ba217803b9bc9cd105e54bc155;hb=ef6813eb67669f873b99c604cb72507792b0a7af;hp=41408c23ccb4a396d92d814366824a5871475ae5;hpb=49bce941a9aae495ee7221bd367791227487b458;p=quix0rs-gnu-social.git diff --git a/actions/shownotice.php b/actions/shownotice.php index 41408c23cc..77ba2ce9fd 100644 --- a/actions/shownotice.php +++ b/actions/shownotice.php @@ -97,17 +97,12 @@ class ShownoticeAction extends OwnerDesignAction $this->profile = $this->notice->getProfile(); if (empty($this->profile)) { - $this->serverError(_('Notice has no profile'), 500); + $this->serverError(_('Notice has no profile.'), 500); return false; } $this->user = User::staticGet('id', $this->profile->id); - if (! $this->notice->is_local) { - common_redirect($this->notice->uri); - return false; - } - $this->avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE); return true; @@ -172,9 +167,9 @@ class ShownoticeAction extends OwnerDesignAction function title() { if (!empty($this->profile->fullname)) { - $base = $this->profile->fullname . ' (' . $this->user->nickname . ') '; + $base = $this->profile->fullname . ' (' . $this->profile->nickname . ')'; } else { - $base = $this->user->nickname; + $base = $this->profile->nickname; } return sprintf(_('%1$s\'s status on %2$s'), @@ -198,13 +193,20 @@ class ShownoticeAction extends OwnerDesignAction if ($this->notice->is_local == Notice::REMOTE_OMB) { if (!empty($this->notice->url)) { - common_redirect($this->notice->url, 301); + $target = $this->notice->url; } else if (!empty($this->notice->uri) && preg_match('/^https?:/', $this->notice->uri)) { - common_redirect($this->notice->uri, 301); + // Old OMB posts saved the remote URL only into the URI field. + $target = $this->notice->uri; + } else { + // Shouldn't happen. + $target = false; + } + if ($target && $target != $this->selfUrl()) { + common_redirect($target, 301); + return false; } - } else { - $this->showPage(); } + $this->showPage(); } /** @@ -275,12 +277,6 @@ class ShownoticeAction extends OwnerDesignAction 'content' => $id->toString())); } - if ($user->jabbermicroid && $user->jabber && $this->notice->uri) { - $id = new Microid('xmpp:', $user->jabber, - $this->notice->uri); - $this->element('meta', array('name' => 'microid', - 'content' => $id->toString())); - } $this->element('link',array('rel'=>'alternate', 'type'=>'application/json+oembed', 'href'=>common_local_url(