fixed list filtering
This commit is contained in:
parent
f29d7096bf
commit
ba8231dc09
|
@ -159,9 +159,16 @@ class lamList {
|
|||
$filter = array();
|
||||
// build filter array
|
||||
for ($i = 0; $i < sizeof($this->attrArray); $i++) {
|
||||
if (isset($_POST["filter" . strtolower($this->attrArray[$i])]) && eregi('^([0-9a-z _\\*\\$-])+$', $_POST["filter" . strtolower($this->attrArray[$i])])) {
|
||||
$filter[$this->attrArray[$i]]['original'] = $_POST["filter" . strtolower($this->attrArray[$i])];
|
||||
$filter[$this->attrArray[$i]]['regex'] = $_POST["filter" . strtolower($this->attrArray[$i])];
|
||||
$foundFilter = null;
|
||||
if (isset($_GET["filter" . strtolower($this->attrArray[$i])])) {
|
||||
$foundFilter = $_GET["filter" . strtolower($this->attrArray[$i])];
|
||||
}
|
||||
if (isset($_POST["filter" . strtolower($this->attrArray[$i])])) {
|
||||
$foundFilter = $_POST["filter" . strtolower($this->attrArray[$i])];
|
||||
}
|
||||
if (isset($foundFilter) && eregi('^([0-9a-z _\\*\\$-])+$', $foundFilter)) {
|
||||
$filter[$this->attrArray[$i]]['original'] = $foundFilter;
|
||||
$filter[$this->attrArray[$i]]['regex'] = $foundFilter;
|
||||
// replace special characters
|
||||
$filter[$this->attrArray[$i]]['regex'] = str_replace("*", "(.)*", $filter[$this->attrArray[$i]]['regex']);
|
||||
$filter[$this->attrArray[$i]]['regex'] = str_replace('$', '[$]', $filter[$this->attrArray[$i]]['regex']);
|
||||
|
@ -333,6 +340,9 @@ class lamList {
|
|||
// print input boxes for filters
|
||||
for ($k = 0; $k < sizeof ($this->descArray); $k++) {
|
||||
$value = "";
|
||||
if (isset($_GET["filter" . strtolower($this->attrArray[$k])])) {
|
||||
$value = " value=\"" . $_GET["filter" . strtolower($this->attrArray[$k])] . "\"";
|
||||
}
|
||||
if (isset($_POST["filter" . strtolower($this->attrArray[$k])])) {
|
||||
$value = " value=\"" . $_POST["filter" . strtolower($this->attrArray[$k])] . "\"";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue