show error if filter is invalid

This commit is contained in:
Roland Gruber 2010-04-07 19:23:11 +00:00
parent 277ba4c4a0
commit 37a9fd2831
1 changed files with 8 additions and 3 deletions

View File

@ -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;