diff --git a/lam/lib/lists.inc b/lam/lib/lists.inc index f72f7bfe..6c8bb716 100644 --- a/lam/lib/lists.inc +++ b/lam/lib/lists.inc @@ -212,9 +212,14 @@ class lamList { if (isset($_POST["filter" . strtolower($this->attrArray[$i])])) { $foundFilter = $_POST["filter" . strtolower($this->attrArray[$i])]; } - if (isset($foundFilter) && preg_match('/^([\p{L}\p{N} _\\*\\$\\.-])+$/iu', $foundFilter)) { // \p{L} matches any Unicode letter - $filterParam .= "&filter" . $this->attrArray[$i] . '=' . $foundFilter; - $LDAPFilterPart .= '(' . $this->attrArray[$i] . '=' . $foundFilter . ')'; + if (isset($foundFilter) && ($foundFilter != '')) { + if (preg_match('/^([\p{L}\p{N} _\\*\\$\\.-])+$/iu', $foundFilter)) { // \p{L} matches any Unicode letter + $filterParam .= "&filter" . $this->attrArray[$i] . '=' . $foundFilter; + $LDAPFilterPart .= '(' . $this->attrArray[$i] . '=' . $foundFilter . ')'; + } + else { + StatusMessage('ERROR', _('Please enter a valid filter. Only letters, numbers and " _*$.-" are allowed.'), htmlspecialchars($foundFilter)); + } } } $this->filterText = $filterParam;