diff options
author | Evan Prodromou <evan@status.net> | 2010-03-17 09:38:39 -0500 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-03-17 09:38:39 -0500 |
commit | 4761c07ad8d76f7c34d4db53d32d15e806ba1e88 (patch) | |
tree | eb3d78ccde1778037165c92b6ec36c7465b54345 /actions/shownotice.php | |
parent | f21f78364a9cbde2ca535a3983b384707ad097ae (diff) | |
parent | f62b8a80cf33ac8529d0736c51dc060a9d235369 (diff) |
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing
Diffstat (limited to 'actions/shownotice.php')
-rw-r--r-- | actions/shownotice.php | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/actions/shownotice.php b/actions/shownotice.php index d09100f67..a23027f7c 100644 --- a/actions/shownotice.php +++ b/actions/shownotice.php @@ -103,11 +103,6 @@ class ShownoticeAction extends OwnerDesignAction $this->user = User::staticGet('id', $this->profile->id); - if ($this->notice->is_local == Notice::REMOTE_OMB) { - common_redirect($this->notice->uri); - return false; - } - $this->avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE); return true; @@ -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(); } /** |