#721 search will trim whitespace and handle more MAC formats

This commit is contained in:
Oliver Gorwits
2020-05-24 19:41:21 +01:00
parent ba32ba3f5d
commit 3662899ede
3 changed files with 10 additions and 1 deletions

View File

@@ -145,6 +145,9 @@ hook 'before' => sub {
$key =~ s|.*/(\w+)/(\w+)$|${1}_${2}|;
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
foreach my $sidebar (keys %{setting('sidebar_defaults')}) {
vars->{'sidebar_defaults'}->{$sidebar} = { map {