forked from GNUsocial/gnu-social
if the id is an alias we redirect using group_id
This commit is contained in:
parent
373206ac00
commit
383703d170
@ -85,12 +85,18 @@ class ApiGroupShowAction extends ApiPrivateAuthAction
|
|||||||
{
|
{
|
||||||
parent::handle($args);
|
parent::handle($args);
|
||||||
|
|
||||||
if (empty($this->group)) {
|
if (!$this->group) {
|
||||||
|
$alias = Group_alias::staticGet('alias', common_canonical_nickname($this->arg('id')));
|
||||||
|
if ($alias) {
|
||||||
|
$args = array('id' => $alias->group_id, 'format'=>$this->format);
|
||||||
|
common_redirect(common_local_url('ApiGroupShow', $args), 301);
|
||||||
|
} else {
|
||||||
$this->clientError(
|
$this->clientError(
|
||||||
_('Group not found!'),
|
_('Group not found!'),
|
||||||
404,
|
404,
|
||||||
$this->format
|
$this->format
|
||||||
);
|
);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user