From: Mikael Nordfeldth Date: Sun, 1 Sep 2013 17:28:57 +0000 (+0200) Subject: Proper definition of $args array in NewgroupAction->prepare X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=83000f6f5eeba23cced4b0b947e0ee6d01daa702;p=quix0rs-gnu-social.git Proper definition of $args array in NewgroupAction->prepare Also, there is no need to do 'return' after throwing a ClientError Exception. And we'll use the Action->clientError for logging benefits until the error handling is properly done all the way to backend. --- diff --git a/actions/newgroup.php b/actions/newgroup.php index 0845f4d6d9..d78683f705 100644 --- a/actions/newgroup.php +++ b/actions/newgroup.php @@ -54,20 +54,19 @@ class NewgroupAction extends FormAction /** * Prepare to run */ - protected function prepare($args) + protected function prepare(array $args=array()) { parent::prepare($args); if (!common_logged_in()) { // TRANS: Client error displayed trying to create a group while not logged in. - $this->clientError(_('You must be logged in to create a group.')); - return false; + $this->clientError(_('You must be logged in to create a group.'), 403); } // $this->scoped is the current user profile if (!$this->scoped->hasRight(Right::CREATEGROUP)) { // TRANS: Client exception thrown when a user tries to create a group while banned. - throw new ClientException(_('You are not allowed to create groups on this site.'), 403); + $this->clientError(_('You are not allowed to create groups on this site.'), 403); } return true;