From ea837cea673fd280caa20b9d8a3814da55bf7643 Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Mon, 6 Aug 2012 22:35:38 +0200 Subject: [PATCH] added missing return statement after showForm call Issue #3125 at http://status.net/open-source/issues/3125 (and its duplicate 3127) describe buggy behaviour when trying to create a new group - i.e. the group is still created but with nickname NULL. The reason the group is created is that when failing Nickname::normalize, the function trySave() in actions/newgroup.php doesn't call 'return' - meaning it just keeps going despite the error thrown. It a So the simple solution to this bug was adding a return call at line 128, inside the catch just after the showForm(...) call. --- actions/newgroup.php | 1 + 1 file changed, 1 insertion(+) diff --git a/actions/newgroup.php b/actions/newgroup.php index cf3125fd87..8e02adaba1 100644 --- a/actions/newgroup.php +++ b/actions/newgroup.php @@ -125,6 +125,7 @@ class NewgroupAction extends Action $nickname = Nickname::normalize($this->trimmed('newnickname')); } catch (NicknameException $e) { $this->showForm($e->getMessage()); + return; } $fullname = $this->trimmed('fullname'); $homepage = $this->trimmed('homepage');