From: Evan Prodromou Date: Thu, 19 Mar 2009 15:36:24 +0000 (-0400) Subject: redirect to original URL or URI for remote notices X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3d8a8aa03c7672966006aa0b7be5da699decbcb3;p=quix0rs-gnu-social.git redirect to original URL or URI for remote notices --- diff --git a/actions/shownotice.php b/actions/shownotice.php index d5f35cd84b..ccae49bb3e 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 content *