LSsearch : fix possibility to specify a filter and a pattern (in the same time)

This commit is contained in:
Benjamin Renard 2020-04-29 15:31:30 +02:00
parent c63040203d
commit 6ea6b78fd4

View file

@ -275,22 +275,18 @@ class LSsearch {
$OK=false; $OK=false;
} }
} }
// Patterm // Patterm
if (isset($params['pattern'])) { if (isset($params['pattern'])) {
if ($params['pattern']=="") { if ($params['pattern']=="") {
$this -> params['pattern'] = NULL; $this -> params['pattern'] = NULL;
$this -> params['filter'] = NULL;
} }
elseif ($this -> isValidPattern($params['pattern'])) { elseif ($this -> isValidPattern($params['pattern'])) {
$this -> params['pattern'] = $params['pattern']; $this -> params['pattern'] = $params['pattern'];
if (!is_string($params['filter'])) {
$this -> params['filter']=NULL;
}
} }
} }
// BaseDN // BaseDN
if (isset($params['basedn']) && is_string($params['basedn'])) { if (isset($params['basedn']) && is_string($params['basedn'])) {
if (isCompatibleDNs(LSsession :: getRootDn(),$params['basedn'])) { if (isCompatibleDNs(LSsession :: getRootDn(),$params['basedn'])) {