lib/private/User: do not change user properties if value has not changed

This commit is contained in:
Leon Klingele 2019-03-06 13:10:18 +01:00 committed by Morris Jobke
parent 3eb0d4f1a4
commit 9a5ca231bf
No known key found for this signature in database
GPG key ID: FE03C3A163FEDE68

View file

@ -139,7 +139,7 @@ class User implements IUser {
public function setDisplayName($displayName) { public function setDisplayName($displayName) {
$displayName = trim($displayName); $displayName = trim($displayName);
$oldDisplayName = $this->getDisplayName(); $oldDisplayName = $this->getDisplayName();
if ($this->backend->implementsActions(Backend::SET_DISPLAYNAME) && !empty($displayName)) { if ($this->backend->implementsActions(Backend::SET_DISPLAYNAME) && !empty($displayName) && $displayName !== $oldDisplayName) {
$result = $this->backend->setDisplayName($this->uid, $displayName); $result = $this->backend->setDisplayName($this->uid, $displayName);
if ($result) { if ($result) {
$this->displayName = $displayName; $this->displayName = $displayName;