LSsearch :: setParams() : Fixed notice PHP

This commit is contained in:
Benjamin Renard 2010-11-16 19:38:55 +01:00
parent 6792005de2
commit aa218fce3b

View file

@ -240,7 +240,8 @@ class LSsearch {
$OK=true;
// Filter
if (isset($params['filter']) && is_string($params['filter'])) {
if (isset($params['filter'])) {
if (is_string($params['filter'])) {
$filter = Net_LDAP2_Filter::parse($params['filter']);
if (!LSerror::isLdapError($filter)) {
$this -> params['filter'] = $filter;
@ -253,6 +254,7 @@ class LSsearch {
elseif($params['filter'] instanceof Net_LDAP2_Filter) {
$this -> params['filter'] =& $params['filter'];
}
}
// Approx
if (isset($params['approx'])) {
@ -277,16 +279,18 @@ class LSsearch {
}
// Patterm
if (isset($params['pattern']) && $params['pattern']=="") {
if (isset($params['pattern'])) {
if ($params['pattern']=="") {
$this -> params['pattern'] = NULL;
$this -> params['filter'] = NULL;
}
elseif (isset($params['pattern']) && self :: isValidPattern($params['pattern'])) {
elseif (self :: isValidPattern($params['pattern'])) {
$this -> params['pattern'] = $params['pattern'];
if (!is_string($params['filter'])) {
$this -> params['filter']=NULL;
}
}
}
// BaseDN