Commit 383703d1 authored by Michele's avatar Michele Committed by Zach Copley

if the id is an alias we redirect using group_id

parent 373206ac
......@@ -85,12 +85,18 @@ class ApiGroupShowAction extends ApiPrivateAuthAction
{
parent::handle($args);
if (empty($this->group)) {
$this->clientError(
_('Group not found!'),
404,
$this->format
);
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(
_('Group not found!'),
404,
$this->format
);
}
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment