diff --git a/src/Symfony/Component/Ldap/CHANGELOG.md b/src/Symfony/Component/Ldap/CHANGELOG.md index fbfe926ac4e0e..e552f5cff5e20 100644 --- a/src/Symfony/Component/Ldap/CHANGELOG.md +++ b/src/Symfony/Component/Ldap/CHANGELOG.md @@ -5,6 +5,7 @@ CHANGELOG ----- * Added the "extra_fields" option, an array of custom fields to pull from the LDAP server + * Added option to allow consumers to force attribute keys to be lowercase when utilizing the Entry class. 4.3.0 ----- diff --git a/src/Symfony/Component/Ldap/Entry.php b/src/Symfony/Component/Ldap/Entry.php index af0edbd1f33ef..b51bab310b0eb 100644 --- a/src/Symfony/Component/Ldap/Entry.php +++ b/src/Symfony/Component/Ldap/Entry.php @@ -18,11 +18,16 @@ class Entry { private $dn; private $attributes; + private $force_lowercase_attributes; - public function __construct(string $dn, array $attributes = []) + public function __construct(string $dn, array $attributes = [], bool $force_lowercase_attributes = false) { $this->dn = $dn; $this->attributes = $attributes; + + if ($force_lowercase_attributes) { + $this->attributes = array_change_key_case($attributes); + } } /**