X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fshownotice.php;h=41408c23ccb4a396d92d814366824a5871475ae5;hb=3d30ad83f881a69d76b57a9af051fef308644987;hp=3d7319489ef489bb14e7655107346dfcecf030e1;hpb=8641cb4591d2b8385a661ea743833392ef45ff8b;p=quix0rs-gnu-social.git diff --git a/actions/shownotice.php b/actions/shownotice.php index 3d7319489e..41408c23cc 100644 --- a/actions/shownotice.php +++ b/actions/shownotice.php @@ -1,6 +1,6 @@ . * * @category Personal - * @package Laconica - * @author Evan Prodromou - * @copyright 2008-2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou + * @copyright 2008-2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -39,10 +39,10 @@ require_once INSTALLDIR.'/lib/feedlist.php'; * Show a single notice * * @category Personal - * @package Laconica - * @author Evan Prodromou + * @package StatusNet + * @author Evan Prodromou * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class ShownoticeAction extends OwnerDesignAction @@ -103,8 +103,8 @@ class ShownoticeAction extends OwnerDesignAction $this->user = User::staticGet('id', $this->profile->id); - if (empty($this->user)) { - $this->serverError(_('Not a local notice'), 500); + if (! $this->notice->is_local) { + common_redirect($this->notice->uri); return false; } @@ -196,7 +196,7 @@ class ShownoticeAction extends OwnerDesignAction { parent::handle($args); - if ($this->notice->is_local == 0) { + if ($this->notice->is_local == Notice::REMOTE_OMB) { if (!empty($this->notice->url)) { common_redirect($this->notice->url, 301); } else if (!empty($this->notice->uri) && preg_match('/^https?:/', $this->notice->uri)) { @@ -284,16 +284,16 @@ class ShownoticeAction extends OwnerDesignAction $this->element('link',array('rel'=>'alternate', 'type'=>'application/json+oembed', 'href'=>common_local_url( - 'api', - array('apiaction'=>'oembed','method'=>'oembed.json'), - array('url'=>$this->notice->uri)), + 'oembed', + array(), + array('format'=>'json','url'=>$this->notice->uri)), 'title'=>'oEmbed'),null); $this->element('link',array('rel'=>'alternate', 'type'=>'text/xml+oembed', 'href'=>common_local_url( - 'api', - array('apiaction'=>'oembed','method'=>'oembed.xml'), - array('url'=>$this->notice->uri)), + 'oembed', + array(), + array('format'=>'xml','url'=>$this->notice->uri)), 'title'=>'oEmbed'),null); } }