forked from GNUsocial/gnu-social
Fix for error output on invalid user ID to api groups list
This commit is contained in:
parent
034e88bcbc
commit
f694f254a4
@ -67,6 +67,12 @@ class ApiGroupListAction extends ApiBareAuthAction
|
|||||||
parent::prepare($args);
|
parent::prepare($args);
|
||||||
|
|
||||||
$this->user = $this->getTargetUser(null);
|
$this->user = $this->getTargetUser(null);
|
||||||
|
|
||||||
|
if (empty($this->user)) {
|
||||||
|
$this->clientError(_('No such user.'), 404, $this->format);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$this->groups = $this->getGroups();
|
$this->groups = $this->getGroups();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -86,11 +92,6 @@ class ApiGroupListAction extends ApiBareAuthAction
|
|||||||
{
|
{
|
||||||
parent::handle($args);
|
parent::handle($args);
|
||||||
|
|
||||||
if (empty($this->user)) {
|
|
||||||
$this->clientError(_('No such user.'), 404, $this->format);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$sitename = common_config('site', 'name');
|
$sitename = common_config('site', 'name');
|
||||||
$title = sprintf(_("%s's groups"), $this->user->nickname);
|
$title = sprintf(_("%s's groups"), $this->user->nickname);
|
||||||
$taguribase = TagURI::base();
|
$taguribase = TagURI::base();
|
||||||
|
Loading…
Reference in New Issue
Block a user