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 @@ -78,6 +78,10 @@ $errors[] = $this->newInvalidError( PhabricatorUser::describeValidUsername(), $xaction); + } else if ($this->generateOldValue($object) === $new) { + $errors[] = $this->newInvalidError( + pht('New username cannot be the old username.'), + $xaction); } $user = id(new PhabricatorPeopleQuery())