diff --git a/src/applications/people/xaction/PhabricatorUserUsernameTransaction.php b/src/applications/people/xaction/PhabricatorUserUsernameTransaction.php --- a/src/applications/people/xaction/PhabricatorUserUsernameTransaction.php +++ b/src/applications/people/xaction/PhabricatorUserUsernameTransaction.php @@ -70,7 +70,11 @@ pht('You must be an administrator to rename users.')); } - if (!strlen($new)) { + if ($this->generateOldValue($object) === $new) { + $errors[] = $this->newInvalidError( + pht('New username cannot be the old username.'), + $xaction); + } else if (!strlen($new)) { $errors[] = $this->newInvalidError( pht('New username is required.'), $xaction);