X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapigroupprofileupdate.php;h=1a489eeefb25e749cbfce5dedd94367797c2808d;hb=4b22b0c42a11f3e5d853a422fe289a2d9b56fc60;hp=9a4592f423db60fed7093116aaa95b735d8926b2;hpb=220b51d8be61e9bd316567f3ad03fffdbc4b7526;p=quix0rs-gnu-social.git diff --git a/actions/apigroupprofileupdate.php b/actions/apigroupprofileupdate.php index 9a4592f423..1a489eeefb 100644 --- a/actions/apigroupprofileupdate.php +++ b/actions/apigroupprofileupdate.php @@ -55,7 +55,7 @@ class ApiGroupProfileUpdateAction extends ApiAuthAction { parent::prepare($args); - $this->nickname = common_canonical_nickname($this->trimmed('nickname')); + $this->nickname = Nickname::normalize($this->trimmed('nickname')); $this->fullname = $this->trimmed('fullname'); $this->homepage = $this->trimmed('homepage'); @@ -106,14 +106,9 @@ class ApiGroupProfileUpdateAction extends ApiAuthAction try { - if (!empty($this->nickname)) { + if (common_config('profile', 'changenick') == true && $this->group->nickname !== $this->nickname) { try { $this->group->nickname = Nickname::normalize($this->nickname, true); - } catch (NicknameTakenException $e) { - // Abort only if the nickname is occupied by _another_ local group - if ($e->profile->id != $this->group->id) { - throw new ApiValidationException($e->getMessage()); - } } catch (NicknameException $e) { throw new ApiValidationException($e->getMessage()); }