From: Michele Date: Thu, 21 Jan 2010 18:30:12 +0000 (+0100) Subject: if the id is an alias we redirect using group_id X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=383703d170c59baf0cae32b612e04b4d292d1880;p=quix0rs-gnu-social.git if the id is an alias we redirect using group_id --- diff --git a/actions/apigroupshow.php b/actions/apigroupshow.php index 7aa49b1bf3..8524281444 100644 --- a/actions/apigroupshow.php +++ b/actions/apigroupshow.php @@ -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; }