Changeset 542
- Timestamp:
- 12/10/13 15:16:45 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r541 r542 209 209 max_fcgi_requests => 100, # reasonable default? 210 210 force_refresh => 1, 211 lowercase => 0, # mangle as little as possible by default 211 212 ); 212 213 … … 238 239 239 240 # Several settings are booleans. Handle multiple possible ways of setting them. 240 for my $boolopt ('log_failures', 'force_refresh' ) {241 for my $boolopt ('log_failures', 'force_refresh', 'lowercase') { 241 242 if ($self->{$boolopt} ne '1' && $self->{$boolopt} ne '0') { 242 243 # true/false, on/off, yes/no all valid. … … 1335 1336 $cfg->{perpage} = $1 if /^perpage\s*=\s*(\d+)/i; 1336 1337 $cfg->{exportcache} = $1 if m{^exportcache\s*=\s*([a-z0-9/_.-]+)}i; 1338 $cfg->{lowercase} = $1 if /^lowercase\s*=\s*([a-z01]+)/i; 1337 1339 # not supported in dns.cgi yet 1338 1340 # $cfg->{templatedir} = $1 if m{^templatedir\s*=\s*([a-z0-9/_.-]+)}i; … … 1819 1821 1820 1822 return ('FAIL',"Invalid domain status") if $state !~ /^\d+$/; 1823 1824 $domain = lc($domain) if $self->{lowercase}; 1821 1825 1822 1826 return ('FAIL', "Invalid characters in domain") if $domain !~ /^[a-zA-Z0-9_.-]+$/; … … 3691 3695 } 3692 3696 3697 if ($self->{lowercase}) { 3698 if ($typemap{$$rectype} ne 'TXT') { 3699 $$host = lc($$host); 3700 $$val = lc($$val); 3701 } else { 3702 # TXT records should preserve user entry in the string. 3703 if ($revrec eq 'n') { 3704 $$host = lc($$host); 3705 } else { 3706 $$val = lc($$val); 3707 } 3708 } 3709 } 3710 3693 3711 # prep for validation 3694 3712 my $addr = NetAddr::IP->new($$val); … … 3822 3840 $$val =~ s/^\s+//; 3823 3841 $$val =~ s/\s+$//; 3842 } 3843 3844 if ($self->{lowercase}) { 3845 if ($typemap{$$rectype} ne 'TXT') { 3846 $$host = lc($$host); 3847 $$val = lc($$val); 3848 } else { 3849 # TXT records should preserve user entry in the string. 3850 if ($revrec eq 'n') { 3851 $$host = lc($$host); 3852 } else { 3853 $$val = lc($$val); 3854 } 3855 } 3824 3856 } 3825 3857
Note:
See TracChangeset
for help on using the changeset viewer.