summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-03-19 11:36:24 -0400
committerEvan Prodromou <evan@controlyourself.ca>2009-03-19 11:38:25 -0400
commit8f64c247fd64e1cce12489c212e55dae16e28c39 (patch)
tree5401188a68c5f0c997a79a6e58ce8138ddfc8086 /actions
parentd1b2a9d7087ecc171f941755b4c3a420cd202842 (diff)
redirect to original URL or URI for remote notices
Diffstat (limited to 'actions')
-rw-r--r--actions/shownotice.php16
1 files changed, 9 insertions, 7 deletions
diff --git a/actions/shownotice.php b/actions/shownotice.php
index d5f35cd84..ccae49bb3 100644
--- a/actions/shownotice.php
+++ b/actions/shownotice.php
@@ -177,10 +177,17 @@ class ShownoticeAction extends Action
{
parent::handle($args);
- $this->showPage();
+ if ($this->notice->is_local == 0) {
+ if (!empty($this->notice->url)) {
+ common_redirect($this->notice->url, 301);
+ } else if (!empty($this->notice->uri) && preg_match('/^https?:/', $this->notice->uri)) {
+ common_redirect($this->notice->uri, 301);
+ }
+ } else {
+ $this->showPage();
+ }
}
-
/**
* Don't show local navigation
*
@@ -191,7 +198,6 @@ class ShownoticeAction extends Action
{
}
-
/**
* Fill the content area of the page
*
@@ -208,8 +214,6 @@ class ShownoticeAction extends Action
$this->elementEnd('ul');
}
-
-
/**
* Don't show page notice
*
@@ -220,7 +224,6 @@ class ShownoticeAction extends Action
{
}
-
/**
* Don't show aside
*
@@ -230,7 +233,6 @@ class ShownoticeAction extends Action
function showAside() {
}
-
/**
* Extra <head> content
*