From: Dirk Koopman Date: Mon, 8 Jun 2020 15:19:09 +0000 (+0100) Subject: fix erronoeus input filter cmd causing crashes X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=b7dedfebf0e11a5fc3050f8a0350a45a5a680e11;p=spider.git fix erronoeus input filter cmd causing crashes --- diff --git a/Changes b/Changes index 6cdc906a..4d546775 100644 --- a/Changes +++ b/Changes @@ -1,7 +1,8 @@ 08Jun20======================================================================= 1. Fix show/mydx (lack of) filtering bug. -2. Add qra locator to prefix_data.pl -3. Add 4 digit qra square for spotted callsign if show/dxgrid is enabled +2. Add qra locator to prefix_data.pl. +3. Add 4 digit qra square for spotted callsign if show/dxgrid is enabled. +4. Fix general filtering bug where erroneous input causes crashing. 03Jun20======================================================================= 1. Make sure that all possible regexes get passed across to the search engine. 2. Fix out of order logging on sh/log queries spanning more than one month. diff --git a/cmd/accept/spots.pl b/cmd/accept/spots.pl index 2bacdfc8..b7920d3f 100644 --- a/cmd/accept/spots.pl +++ b/cmd/accept/spots.pl @@ -11,4 +11,4 @@ my $type = 'accept'; my $sort = 'spots'; my ($r, $filter, $fno) = $Spot::filterdef->cmd($self, $sort, $type, $line); -return (0, $r ? $filter : $self->msg('filter1', $fno, $filter->{name})); +return (1, $r ? $filter : $self->msg('filter1', $fno, $filter->{name})); diff --git a/data/bands.pl b/data/bands.pl index 3ac13d12..2c47f8c2 100644 --- a/data/bands.pl +++ b/data/bands.pl @@ -188,6 +188,8 @@ 'pmruhf' => bless ( { band => [425000, 430000, 440000, 471000], }, 'Bands'), + hf => bless ( { band => [1800, 29999], }, 'Bands'), + vhf => bless ( { band => [30000, 299999], }, 'Bands'), ); # @@ -201,9 +203,9 @@ %regions = ( vlf => [qw( 73khz 136khz 500khz )], - hf => [qw( 160m 80m 60m 40m 30m 20m 17m 15m 12m 10m )], + # hf => [qw( 160m 80m 60m 40m 30m 20m 17m 15m 12m 10m )], contesthf => [qw( 160m 80m 40m 20m 15m 10m )], - vhf => [qw( 6m 4m 2m 220 )], + # vhf => [qw( 6m 4m 2m 220 )], vhfradio => [qw( band1 band2 )], vhftv => [qw( band1 band3 )], uhf => [qw( 70cm 23cm )], diff --git a/perl/Filter.pm b/perl/Filter.pm index 898b004a..12caeef3 100644 --- a/perl/Filter.pm +++ b/perl/Filter.pm @@ -540,9 +540,9 @@ sub parse last; } } - return (0, $dxchan->msg('e20', $tok)) unless $found; + return (1, $dxchan->msg('e20', $tok)) unless $found; } else { - return (0, $dxchan->msg('filter2', $tok)); + return (1, $dxchan->msg('filter2', $tok)); } $lasttok = $tok; } @@ -561,13 +561,13 @@ sub parse sub cmd { my ($self, $dxchan, $sort, $type, $line) = @_; - return $dxchan->msg('filter5') unless $line; my ($r, $filter, $fno, $user, $s) = $self->parse($dxchan, $sort, $line); + return (1, $filter) if $r; + my $u = DXUser::get_current($user); return (1, $dxchan->msg('isow', $user)) if $u && $u->isolate; - return (1, $filter) if $r; my $fn = "filter$fno";