Commit bf4f9e3c authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Merge branch...

Merge branch '6188-invalid-value-in-ou-for-an-object-type-creates-php-errors-in-unexpected-places' into '1.4-dev'

Resolve "Invalid value in 'ou' for an object type creates PHP errors in unexpected places"

See merge request fusiondirectory/fd!932
Showing with 12 additions and 10 deletions
+12 -10
......@@ -440,16 +440,18 @@ class objects
$infos['filterRDN'] = '';
} else {
$parts = ldap_explode_dn(preg_replace('/,$/', '', $infos['ou']), 0);
unset($parts['count']);
$dnFilter = [];
foreach ($parts as $part) {
preg_match('/([^=]+)=(.*)$/', $part, $m);
$dnFilter[] = '('.$m[1].':dn:='.$m[2].')';
}
if (count($dnFilter) > 1) {
$infos['filterRDN'] = '(&'.implode('', $dnFilter).')';
} else {
$infos['filterRDN'] = $dnFilter[0];
if ($parts !== FALSE) {
unset($parts['count']);
$dnFilter = [];
foreach ($parts as $part) {
preg_match('/([^=]+)=(.*)$/', $part, $m);
$dnFilter[] = '('.$m[1].':dn:='.$m[2].')';
}
if (count($dnFilter) > 1) {
$infos['filterRDN'] = '(&'.implode('', $dnFilter).')';
} else {
$infos['filterRDN'] = $dnFilter[0];
}
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment