fix erronoeus input filter cmd causing crashes
authorDirk Koopman <djk@tobit.co.uk>
Mon, 8 Jun 2020 15:19:09 +0000 (16:19 +0100)
committerDirk Koopman <djk@tobit.co.uk>
Mon, 8 Jun 2020 15:19:09 +0000 (16:19 +0100)
Changes
cmd/accept/spots.pl
data/bands.pl
perl/Filter.pm

diff --git a/Changes b/Changes
index 6cdc906a0d9e39ccb8d76951172f8de4b784e1b4..4d54677552464a3cebd88a6bd240d5f5b3702c36 100644 (file)
--- 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.
index 2bacdfc8ec5d5a4aa91cece42ca47ea54906581a..b7920d3fdfe8b6195e107635081b58e585329aad 100644 (file)
@@ -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})); 
index 3ac13d125c1ee285778a9804f5f5c4b2b3138caa..2c47f8c2186d86feb1b358a7f5138bf0a4a9308f 100644 (file)
 
                  'pmruhf' => bless ( { band => [425000, 430000, 440000, 471000],
                                                          }, 'Bands'),
+                  hf => bless ( { band => [1800, 29999], }, 'Bands'), 
+                  vhf => bless ( { band => [30000, 299999], }, 'Bands'), 
                 );
 
 #
 
 %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 )],
index 898b004a71c2cc664373f68d3665d02b03032922..12caeef398d21c20b95d1f87e43b48d9c1bdd11d 100644 (file)
@@ -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";