X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapigroupmembership.php;h=7ad8fb767ec5731c24a3ed8a1b0b9a3f37d518a9;hb=59043dca7fb6f974b11797c4d0f20e5b78b0611d;hp=99ac965fa18d2c5aa9de82cf91ef317a3be8e025;hpb=c4b8f68a1a3ed6422a2ed1cb7a8b5b5c65011b5f;p=quix0rs-gnu-social.git diff --git a/actions/apigroupmembership.php b/actions/apigroupmembership.php index 99ac965fa1..7ad8fb767e 100644 --- a/actions/apigroupmembership.php +++ b/actions/apigroupmembership.php @@ -66,6 +66,12 @@ class ApiGroupMembershipAction extends ApiPrivateAuthAction parent::prepare($args); $this->group = $this->getTargetGroup($this->arg('id')); + if (empty($this->group)) { + // TRANS: Client error displayed trying to show group membership on a non-existing group. + $this->clientError(_('Group not found.'), 404, $this->format); + return false; + } + $this->profiles = $this->getProfiles(); return true; @@ -84,12 +90,6 @@ class ApiGroupMembershipAction extends ApiPrivateAuthAction { parent::handle($args); - if (empty($this->group)) { - // TRANS: Client error displayed trying to show group membership on a non-existing group. - $this->clientError(_('Group not found.'), 404, $this->format); - return false; - } - // XXX: RSS and Atom switch($this->format) { @@ -101,7 +101,7 @@ class ApiGroupMembershipAction extends ApiPrivateAuthAction break; default: $this->clientError( - // TRANS: Client error displayed trying to execute an unknown API method showing group membership. + // TRANS: Client error displayed when coming across a non-supported API method. _('API method not found.'), 404, $this->format