X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapigroupprofileupdate.php;h=1a489eeefb25e749cbfce5dedd94367797c2808d;hb=4694d068f965ec733edcfe5c9afe8244ae01f00a;hp=9a4592f423db60fed7093116aaa95b735d8926b2;hpb=f8b49e69d02806110cbc780fce4671fbe3357438;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()); }