Port filter supports basic */?/%/_ wildcards (closes #25)

This commit is contained in:
Oliver Gorwits
2012-08-27 21:17:08 +01:00
parent 52468b0ac0
commit 3fefb5b7f0
2 changed files with 5 additions and 0 deletions

View File

@@ -113,6 +113,10 @@ ajax '/ajax/content/device/ports' => sub {
return unless $set->count;
}
else {
$q =~ s/\*/%/g if index($q, '*') >= 0;
$q =~ s/\?/_/g if index($q, '?') >= 0;
$q = { '-ilike' => $q };
if ($set->search({'me.port' => $q})->count) {
$set = $set->search({'me.port' => $q});
}