mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-21 23:43:17 +01:00
added two more match-type values from CardDAV:text-match
This commit is contained in:
parent
0a7b7e40c8
commit
b4b04844fe
@ -310,6 +310,8 @@ class groupdav_principals extends groupdav_handler
|
||||
/**
|
||||
* Match using $match_type
|
||||
*
|
||||
* It's not defined in WebDAV ACL, but CardDAV:text-match seems similar
|
||||
*
|
||||
* @param string $value value to test
|
||||
* @param string $match criteria/sub-string
|
||||
* @param string $match_type='contains' or 'starts-with'
|
||||
@ -318,9 +320,15 @@ class groupdav_principals extends groupdav_handler
|
||||
{
|
||||
switch($match_type)
|
||||
{
|
||||
case 'equals':
|
||||
return $value === $match;
|
||||
|
||||
case 'starts-with':
|
||||
return stripos($value, $match) === 0;
|
||||
|
||||
case 'ends-with':
|
||||
return stripos($value, $match) === strlen($value) - strlen($match);
|
||||
|
||||
case 'contains':
|
||||
default:
|
||||
return stripos($value, $match) !== false;
|
||||
|
Loading…
Reference in New Issue
Block a user