#721 search will trim whitespace and handle more MAC formats
This commit is contained in:
6
Changes
6
Changes
@@ -1,3 +1,9 @@
|
|||||||
|
2.045006 - 2020-05-24
|
||||||
|
|
||||||
|
[ENHANCEMENTS]
|
||||||
|
|
||||||
|
* #721 search will trim whitespace and handle more MAC formats
|
||||||
|
|
||||||
2.045005 - 2020-05-18
|
2.045005 - 2020-05-18
|
||||||
|
|
||||||
[BUG FIXES]
|
[BUG FIXES]
|
||||||
|
|||||||
@@ -145,6 +145,9 @@ hook 'before' => sub {
|
|||||||
$key =~ s|.*/(\w+)/(\w+)$|${1}_${2}|;
|
$key =~ s|.*/(\w+)/(\w+)$|${1}_${2}|;
|
||||||
var(sidebar_key => $key);
|
var(sidebar_key => $key);
|
||||||
|
|
||||||
|
# trim whitespace
|
||||||
|
params->{'q'} =~ s/^\s+|\s+$//g if param('q');
|
||||||
|
|
||||||
# copy sidebar defaults into vars so we can mess about with it
|
# copy sidebar defaults into vars so we can mess about with it
|
||||||
foreach my $sidebar (keys %{setting('sidebar_defaults')}) {
|
foreach my $sidebar (keys %{setting('sidebar_defaults')}) {
|
||||||
vars->{'sidebar_defaults'}->{$sidebar} = { map {
|
vars->{'sidebar_defaults'}->{$sidebar} = { map {
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ get '/search' => require_login sub {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# pick most likely tab for initial results
|
# pick most likely tab for initial results
|
||||||
if ($q =~ m/^\d+$/) {
|
if ($q =~ m/^[0-9]+$/ and $q < 4096) {
|
||||||
params->{'tab'} = 'vlan';
|
params->{'tab'} = 'vlan';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Reference in New Issue
Block a user