summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2014-12-12 08:32:10 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2014-12-12 08:32:10 (GMT)
commit8ccab87b65ee775c21c75f3d1fff7ea519e5c7e2 (patch)
tree795cf884d3efbe22178d4eca5d80a183f1be6d92
parent0f464b8fedd05b7c4f1a58addfadb3806a85a8fe (diff)
downloadNet_LDAP3-8ccab87b65ee775c21c75f3d1fff7ea519e5c7e2.tar.gz
Fix OU change handling if provided OU attribute is an array
-rw-r--r--lib/Net/LDAP3.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Net/LDAP3.php b/lib/Net/LDAP3.php
index d46ee20..1da3da3 100644
--- a/lib/Net/LDAP3.php
+++ b/lib/Net/LDAP3.php
@@ -1249,8 +1249,8 @@ class Net_LDAP3
// This is me cheating. Remove this special attribute.
if (array_key_exists('ou', $old_attrs) || array_key_exists('ou', $new_attrs)) {
- $old_ou = $old_attrs['ou'];
- $new_ou = $new_attrs['ou'];
+ $old_ou = is_array($old_attrs['ou']) ? array_shift($old_attrs['ou']) : $old_attrs['ou'];
+ $new_ou = is_array($new_attrs['ou']) ? array_shift($new_attrs['ou']) : $new_attrs['ou'];
unset($old_attrs['ou']);
unset($new_attrs['ou']);
}