From 8ccab87b65ee775c21c75f3d1fff7ea519e5c7e2 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 12 Dec 2014 03:32:10 -0500 Subject: Fix OU change handling if provided OU attribute is an array --- lib/Net/LDAP3.php | 4 ++-- 1 file 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']); } -- cgit v0.12