Changeset 90 for trunk/uribl/uridb.cgi


Ignore:
Timestamp:
09/16/25 15:03:29 (4 weeks ago)
Author:
Kris Deugau
Message:

/trunk/uribl

Minor instantiation and oops cleanup
Expand the scope of trimming submitted URIs; form will now extract the

FQDN for many links, email addresses, and allows for a secondary blzone
(altblzone) to enable use of different names during eg a transition
from one base name to another

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/uribl/uridb.cgi

    r86 r90  
    6262$cfgname =~ s|_$||;
    6363
    64 my $uridb = new URIdb (configfile => "/etc/uridb/$cfgname.conf");
     64my $uridb = new URIdb (configfile => "/etc/uridb/$cfgname.conf")
     65        or die "urk:  something went wrong creating UIRdb\n";
     66$uridb->connect;
    6567
    6668my $page;
     
    9698  foreach my $domain (@dombase) {
    9799    my %row;
     100    # strip off URL protocol
     101    $domain =~ s{^https?://}{};
     102    # clean up/strip off extraneous bits from extract-data's tinydns output
    98103    ($domain) = split /:/, $domain;
    99104    $domain =~ s/^\+//;
    100     $domain =~ s/\.uribl.company.com//;
     105    $domain =~ s/\.$uridb->{misc}{blzone}//;
     106    # and a secondary zone name Just In Case(TM)
     107    $domain =~ s/\.$uridb->{misc}{altblzone}//;
     108    # trim any non-FQDN URI parts
     109    $domain =~ s{/.+$}{};
     110    # QoL: allow just pasting an email address
     111    $domain =~ s/[^@]+\@//;
     112    $domain =~ s/\>.*$//;
    101113    chomp $domain;
    102114    # now, see if it's multilisted
Note: See TracChangeset for help on using the changeset viewer.