redirect to original URL or URI for remote notices

This commit is contained in:
Evan Prodromou 2009-03-19 11:36:24 -04:00
parent 739bb522fd
commit 3d8a8aa03c

View File

@ -177,9 +177,16 @@ class ShownoticeAction extends Action
{ {
parent::handle($args); parent::handle($args);
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(); $this->showPage();
} }
}
/** /**
* Don't show local navigation * Don't show local navigation
@ -191,7 +198,6 @@ class ShownoticeAction extends Action
{ {
} }
/** /**
* Fill the content area of the page * Fill the content area of the page
* *
@ -208,8 +214,6 @@ class ShownoticeAction extends Action
$this->elementEnd('ul'); $this->elementEnd('ul');
} }
/** /**
* Don't show page notice * Don't show page notice
* *
@ -220,7 +224,6 @@ class ShownoticeAction extends Action
{ {
} }
/** /**
* Don't show aside * Don't show aside
* *
@ -230,7 +233,6 @@ class ShownoticeAction extends Action
function showAside() { function showAside() {
} }
/** /**
* Extra <head> content * Extra <head> content
* *