- Timestamp:
- 06/26/12 13:40:41 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r347 r349 299 299 $hname =~ s/^\*\.//; # this should be impossible to find in the domains table. 300 300 my @hostbits = split /\./, $hname; 301 my $sth = $dbh->prepare("SELECT count(*),domain_id FROM domains WHERE domain = ?GROUP BY domain_id");301 my $sth = $dbh->prepare("SELECT count(*),domain_id FROM domains WHERE lower(domain) = lower(?) GROUP BY domain_id"); 302 302 foreach (@hostbits) { 303 303 $sth->execute($hname); … … 1705 1705 return ('FAIL', "Invalid characters in domain") if $domain !~ /^[a-zA-Z0-9_.-]+$/; 1706 1706 1707 my $sth = $dbh->prepare("SELECT domain_id FROM domains WHERE domain=?");1707 my $sth = $dbh->prepare("SELECT domain_id FROM domains WHERE lower(domain) = lower(?)"); 1708 1708 my $dom_id; 1709 1709 … … 1725 1725 1726 1726 # get the ID... 1727 ($dom_id) = $dbh->selectrow_array("SELECT domain_id FROM domains WHERE domain=?", undef, ($domain)); 1727 ($dom_id) = $dbh->selectrow_array("SELECT domain_id FROM domains WHERE lower(domain) = lower(?)", 1728 undef, ($domain)); 1728 1729 1729 1730 _log($dbh, (domain_id => $dom_id, group_id => $group, … … 1887 1888 my $dbh = shift; 1888 1889 my $domain = shift; 1889 my ($domid) = $dbh->selectrow_array("SELECT domain_id FROM domains WHERE domain=?", undef, ($domain) ); 1890 my ($domid) = $dbh->selectrow_array("SELECT domain_id FROM domains WHERE lower(domain) = lower(?)", 1891 undef, ($domain) ); 1890 1892 $errstr = $DBI::errstr if !$domid; 1891 1893 return $domid if $domid; … … 3813 3815 } else { 3814 3816 # default to domain 3815 ($zone_id) = $dbh->selectrow_array("SELECT domain_id FROM domains WHERE domain=?",3817 ($zone_id) = $dbh->selectrow_array("SELECT domain_id FROM domains WHERE lower(domain) = lower(?)", 3816 3818 undef, ($zone)); 3817 3819 $domain_id = $zone_id;
Note:
See TracChangeset
for help on using the changeset viewer.