summaryrefslogtreecommitdiff
path: root/actions/shownotice.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-03-22 13:56:16 -0700
committerBrion Vibber <brion@pobox.com>2010-03-22 13:56:16 -0700
commite89908f26140c217e01b2f8f755712f38f3935f3 (patch)
tree6b241fc2e33f3528cf48b415ef67906826b02e24 /actions/shownotice.php
parent714d920faea302b55857cc3bec4e9e6160ea136a (diff)
parenteb563937df921e5fc67ca0c87e229feb2907fd19 (diff)
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 1.0.x
Conflicts: lib/channel.php scripts/imdaemon.php
Diffstat (limited to 'actions/shownotice.php')
-rw-r--r--actions/shownotice.php22
1 files changed, 12 insertions, 10 deletions
diff --git a/actions/shownotice.php b/actions/shownotice.php
index d0528a9f0..12e1d77f8 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;
@@ -172,7 +167,7 @@ class ShownoticeAction extends OwnerDesignAction
function title()
{
if (!empty($this->profile->fullname)) {
- $base = $this->profile->fullname . ' (' . $this->profile->nickname . ') ';
+ $base = $this->profile->fullname . ' (' . $this->profile->nickname . ')';
} else {
$base = $this->profile->nickname;
}
@@ -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();
}
/**