Changeset 160 for trunk/DNSDB.pm
- Timestamp:
- 11/02/11 18:12:35 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r157 r160 1212 1212 1213 1213 my $filter = shift || ''; 1214 # keep the nasties down, since we can't ?-sub this bit. :/1215 # note this is chars allowed in DNS hostnames1216 $filter =~ s/[^a-zA-Z0-9_.:-]//g;1217 1214 1218 1215 $type = 'y' if $type eq 'def'; … … 1228 1225 } 1229 1226 $sql .= " AND NOT r.type=$reverse_typemap{SOA}"; 1230 $sql .= " AND host ILIKE '%$filter%'" if $filter;1227 $sql .= " AND host ~* ?" if $filter; 1231 1228 # use alphaorder column for "correct" ordering of sort-by-type instead of DNS RR type number 1232 1229 $sql .= " ORDER BY ".($order eq 'type' ? 't.alphaorder' : "r.$order")." $direction"; … … 1291 1288 1292 1289 # Validation 1290 if ($rectype == $reverse_typemap{A}) { 1291 return ("FAIL", "IPv4 addresses must be in the format n.n.n.n") 1292 unless $val =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/; 1293 } 1294 if ($rectype == $reverse_typemap{AAAA}) { 1295 return ("FAIL", "IPv6 addresses must be in the format h:h:h::h") 1296 unless $val =~ /^[a-fA-F0-9:]+$/ 1297 } 1293 1298 if ($rectype == $reverse_typemap{A} or $rectype == $reverse_typemap{AAAA}) { 1294 1299 my $tmpip = new NetAddr::IP $val or
Note:
See TracChangeset
for help on using the changeset viewer.