From d2e4082dbc28b6b6b1295990187155ea70375d3c Mon Sep 17 00:00:00 2001 From: Lukas Metzger Date: Wed, 11 Apr 2018 08:44:44 +0200 Subject: [PATCH] Fixed bug where renaming of user to current name failed --- backend/src/operations/Users.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/operations/Users.php b/backend/src/operations/Users.php index 7b3e4d1..8170bba 100644 --- a/backend/src/operations/Users.php +++ b/backend/src/operations/Users.php @@ -287,7 +287,8 @@ class Users $query = $this->db->prepare('SELECT id FROM users WHERE name=:name AND backend=\'native\''); $query->bindValue(':name', $name); $query->execute(); - if ($query->fetch() !== false) { + $record = $query->fetch(); + if ($record !== false && intval($record['id']) !== $userId) { throw new \Exceptions\AlreadyExistentException(); } }