X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FSpot.pm;h=a2b9eee04efe5d9856f4e9d104721350818e495a;hb=a386178f3c1bfcd3d0975d94448245b8c4203988;hp=a87b9c85b1b6c8581f2ad4675675b2654ea584bc;hpb=d2580480d24be5e8f1beb4aeeb40980db0dedde0;p=spider.git diff --git a/perl/Spot.pm b/perl/Spot.pm index a87b9c85..a2b9eee0 100644 --- a/perl/Spot.pm +++ b/perl/Spot.pm @@ -3,7 +3,7 @@ # # Copyright (c) - 1998 Dirk Koopman G1TLH # -# $Id$ +# # package Spot; @@ -21,7 +21,8 @@ use QSL; use strict; -use vars qw($fp $statp $maxspots $defaultspots $maxdays $dirprefix $duplth $dupage $filterdef $totalspots $hfspots $vhfspots $maxcalllth $can_encode); +use vars qw($fp $statp $maxspots $defaultspots $maxdays $dirprefix $duplth $dupage $filterdef + $totalspots $hfspots $vhfspots $maxcalllth $can_encode $use_db_for_search); $fp = undef; $statp = undef; @@ -52,6 +53,7 @@ $filterdef = bless ([ ], 'Filter::Cmd'); $totalspots = $hfspots = $vhfspots = 0; +$use_db_for_search = 0; # create a Spot Object sub new @@ -250,7 +252,7 @@ sub search $to = $from + $maxspots if $to - $from > $maxspots || $to - $from <= 0; - if ($main::dbh) { + if ($main::dbh && $use_db_for_search) { return $main::dbh->spot_search($expr, $dayfrom, $dayto, $to-$from, $dxchan); } @@ -404,9 +406,8 @@ sub dup my $otext = $text; $text = Encode::encode("iso-8859-1", $text) if $main::can_encode && Encode::is_utf8($text, 1); $text =~ s/^\+\w+\s*//; # remove leading LoTW callsign - $text = pack("C*", map {$_ & 127} unpack("C*", $text)); $text =~ s/\s{2,}[\dA-Z]?[A-Z]\d?$// if length $text > 24; - $text =~ s/[^\w]//g; + $text =~ s/[\W\x00-\x2F\x7B-\xFF]//g; # tautology, just to make quite sure! $text = substr($text, 0, $duplth) if length $text > $duplth; my $ldupkey = "X$freq|$call|$by|$text"; my $t = DXDupe::find($ldupkey);