summaryrefslogtreecommitdiff
path: root/lib/Net/LDAP3.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Net/LDAP3.php')
-rw-r--r--lib/Net/LDAP3.php9
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__);