From 0fa894be9de4d79499da389965f628c020bb8c8b Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 30 Mar 2010 11:44:13 -0700 Subject: Fixes for apigrouplist - notice spew from undefined var, notice spew from missing escape in sprintf format --- actions/apigrouplist.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actions/apigrouplist.php') diff --git a/actions/apigrouplist.php b/actions/apigrouplist.php index 98fdb0497..a6f5d03cc 100644 --- a/actions/apigrouplist.php +++ b/actions/apigrouplist.php @@ -66,7 +66,7 @@ class ApiGroupListAction extends ApiBareAuthAction { parent::prepare($args); - $this->user = $this->getTargetUser($id); + $this->user = $this->getTargetUser(null); $this->groups = $this->getGroups(); return true; @@ -100,7 +100,7 @@ class ApiGroupListAction extends ApiBareAuthAction array('nickname' => $this->user->nickname) ); $subtitle = sprintf( - _("Groups %1$s is a member of on %2$s."), + _("Groups %1\$s is a member of on %2\$s."), $this->user->nickname, $sitename ); -- cgit v1.2.3-54-g00ecf From 37b41d227d180ae303ff623fe24223ebcf5d5f9a Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 30 Mar 2010 11:47:23 -0700 Subject: Fix for error output on invalid user ID to api groups list --- actions/apigrouplist.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'actions/apigrouplist.php') diff --git a/actions/apigrouplist.php b/actions/apigrouplist.php index a6f5d03cc..dd2a68c66 100644 --- a/actions/apigrouplist.php +++ b/actions/apigrouplist.php @@ -67,6 +67,12 @@ class ApiGroupListAction extends ApiBareAuthAction parent::prepare($args); $this->user = $this->getTargetUser(null); + + if (empty($this->user)) { + $this->clientError(_('No such user.'), 404, $this->format); + return false; + } + $this->groups = $this->getGroups(); return true; @@ -86,11 +92,6 @@ class ApiGroupListAction extends ApiBareAuthAction { parent::handle($args); - if (empty($this->user)) { - $this->clientError(_('No such user.'), 404, $this->format); - return; - } - $sitename = common_config('site', 'name'); $title = sprintf(_("%s's groups"), $this->user->nickname); $taguribase = TagURI::base(); -- cgit v1.2.3-54-g00ecf