mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-27 02:14:45 +01:00
also match against trimmed database entries when categories should be searched by $filter
This commit is contained in:
parent
92da2abb2e
commit
da7db21806
@ -156,17 +156,41 @@ class categories
|
||||
{
|
||||
if (!is_array($val) && $val[0] === '!')
|
||||
{
|
||||
if ($cat[$col] == substr($val,1)) continue 2; // 2 for BOTH foreach!
|
||||
// also match against trimmed database entry on name and description fields
|
||||
if (($col == 'name' || $col == 'description') && is_string($cat[$col]))
|
||||
{
|
||||
if ($cat[$col] == substr($val,1) || trim($cat[$col]) == substr($val,1)) continue 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($cat[$col] == substr($val,1)) continue 2;
|
||||
}
|
||||
}
|
||||
elseif (is_array($val))
|
||||
{
|
||||
// also match against trimmed database entry on name and description fields
|
||||
if (($col == 'name' || $col == 'description') && is_string($cat[$col]))
|
||||
{
|
||||
if (!in_array($cat[$col],$val) && !in_array(trim($cat[$col]),$val)) continue 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!in_array($cat[$col],$val)) continue 2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// also match against trimmed database entry on name and description fields
|
||||
if (($col == 'name' || $col == 'description') && is_string($cat[$col]))
|
||||
{
|
||||
if ($cat[$col] != $val && trim($cat[$col]) != $val) continue 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($cat[$col] != $val) continue 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
// check if certain parent required
|
||||
if ($parent_id && !in_array($cat['parent'],(array)$parent_id)) continue;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user