Redirect instead of showing an error when the user visits a non-local notice's url
Use consistent logic in display non-local notice links Fixes http://laconi.ca/trac/ticket/1788
This commit is contained in:
parent
11086c7823
commit
a7a87913be
|
@ -97,8 +97,8 @@ class ShownoticeAction extends OwnerDesignAction
|
||||||
|
|
||||||
$this->user = User::staticGet('id', $this->profile->id);
|
$this->user = User::staticGet('id', $this->profile->id);
|
||||||
|
|
||||||
if (empty($this->user)) {
|
if (! $this->notice->is_local) {
|
||||||
$this->serverError(_('Not a local notice'), 500);
|
common_redirect($this->notice->uri);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -350,11 +350,10 @@ class NoticeListItem extends Widget
|
||||||
|
|
||||||
function showNoticeLink()
|
function showNoticeLink()
|
||||||
{
|
{
|
||||||
$noticeurl = common_local_url('shownotice',
|
if($this->notice->is_local){
|
||||||
|
$noticeurl = common_local_url('shownotice',
|
||||||
array('notice' => $this->notice->id));
|
array('notice' => $this->notice->id));
|
||||||
// XXX: we need to figure this out better. Is this right?
|
}else{
|
||||||
if (strcmp($this->notice->uri, $noticeurl) != 0 &&
|
|
||||||
preg_match('/^http/', $this->notice->uri)) {
|
|
||||||
$noticeurl = $this->notice->uri;
|
$noticeurl = $this->notice->uri;
|
||||||
}
|
}
|
||||||
$this->out->elementStart('a', array('rel' => 'bookmark',
|
$this->out->elementStart('a', array('rel' => 'bookmark',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user