diff options
author | Aleksander Machniak <alec@alec.pl> | 2013-09-17 18:04:14 (GMT) |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2013-09-17 18:04:14 (GMT) |
commit | c60ee9afdf7b8d17457485d0a3a37b441ceff2f8 (patch) | |
tree | 6f7cd255ef558f2b60c2bbc8e54f8950f21c1910 | |
parent | 5f23f586766d1172dacd645ca2a5210769d2ed90 (diff) | |
download | Net_LDAP3-c60ee9afdf7b8d17457485d0a3a37b441ceff2f8.tar.gz |
Skip searching for nsuniqueid if searched value is too short to be a unique identifier (Bug #2216)
-rw-r--r-- | lib/Net/LDAP3.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/Net/LDAP3.php b/lib/Net/LDAP3.php index 9251d2e..b57e04b 100644 --- a/lib/Net/LDAP3.php +++ b/lib/Net/LDAP3.php @@ -808,12 +808,19 @@ class Net_LDAP3 { $this->_debug("entry_dn on subject $subject"); $is_dn = ldap_explode_dn($subject, 1); - $this->_debug($is_dn ? "entry_dn is a dn" : "entry_dn is not a dn"); if (is_array($is_dn) && array_key_exists("count", $is_dn) && $is_dn["count"] > 0) { + $this->_debug("$subject is a dn"); return $subject; } + $this->_debug("$subject is not a dn"); + + if (strlen($subject) < 16) { + $this->_debug("$subject is too short to be a unique identifier"); + return; + } + $unique_attr = $this->config_get('unique_attribute', 'nsuniqueid'); $this->_debug("Using unique_attribute " . var_export($unique_attr, TRUE) . " at " . __FILE__ . ":" . __LINE__); |