Skip to content

Commit ef2ea5e

Browse files
committed
Fix detection of new attributes added to an entry
1 parent 91b5b53 commit ef2ea5e

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

app/Ldap/Entry.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,10 @@ public function setAttribute(string $key, mixed $value): static
9494

9595
$key = $this->normalizeAttributeKey($key);
9696

97-
if ((! $this->objects->get($key)) && $value) {
98-
$this->objects->put($key,Factory::create($key,$value));
97+
if ((! $this->objects->get($key)) && $value)
98+
$this->objects->put($key,Factory::create($key,[]));
9999

100-
} elseif ($this->objects->get($key)) {
101-
$this->objects->get($key)->value = $this->attributes[$key];
102-
}
100+
$this->objects->get($key)->value = $this->attributes[$key];
103101

104102
return $this;
105103
}
@@ -164,7 +162,6 @@ public function addAttribute(string $key,mixed $value): void
164162
/**
165163
* Convert all our attribute values into an array of Objects
166164
*
167-
* @param array $attributes
168165
* @return Collection
169166
*/
170167
public function getAttributesAsObjects(): Collection

0 commit comments

Comments
 (0)