mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-26 11:52:59 +01:00
LSldap : added methode isValidFilter()
This commit is contained in:
parent
bc1a92ec35
commit
9eb547d20d
1 changed files with 23 additions and 0 deletions
|
@ -429,6 +429,29 @@ class LSldap {
|
|||
return $filter;
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror :: addErrorCode(0,$filter -> getMessage());
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check LDAP Filters String
|
||||
*
|
||||
* @params string A LDAP filter as string
|
||||
*
|
||||
* @retval boolean True only if the filter could be parsed
|
||||
**/
|
||||
public static function isValidFilter($filter) {
|
||||
if (is_string($filter) && !empty($filter)) {
|
||||
$filter=Net_LDAP2_Filter::parse($filter);
|
||||
if (!Net_LDAP2::isError($filter)) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
LSerror :: addErrorCode(0,$filter -> getMessage());
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue