ignore exception, do not try to match id, if pattern is no valid GUID for AD

This commit is contained in:
Ralf Becker 2019-03-10 10:04:51 +01:00
parent bf51083891
commit bec78c475a
2 changed files with 9 additions and 1 deletions

View File

@ -150,6 +150,7 @@ class Ads extends Ldap
* Return LDAP filter for contact id
*
* @param string $contact_id
* @throws Api\Exception\AssertionFailed if $contact_id is no valid GUID
* @return string
*/
protected function id_filter($contact_id)

View File

@ -382,6 +382,7 @@ class Ldap
* Return LDAP filter for (multiple) contact ids
*
* @param array|string $ids
* @throws Api\Exception\AssertionFailed if $contact_id is no valid GUID (for ADS!)
* @return string
*/
protected function ids_filter($ids)
@ -809,7 +810,13 @@ class Ldap
{
if (in_array($egwSearchKey, array('id','contact_id')))
{
$searchFilter .= $this->ids_filter($searchValue);
try {
$searchFilter .= $this->ids_filter($searchValue);
}
// catch and ignore exception caused by id not being a valid GUID
catch(Api\Exception\AssertionFailed $e) {
unset($e);
}
continue;
}
foreach($this->schema2egw as $mapping)