Changeset 508
- Timestamp:
- 05/09/13 16:10:50 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r506 r508 2591 2591 2592 2592 # protection against bad or missing arguments 2593 $args{sortorder} = 'ASC' if !$args{sortorder}; 2593 $args{sortorder} = 'ASC' if !$args{sortorder} || !grep /^$args{sortorder}$/, ('ASC','DESC'); 2594 $args{sortby} = 'group' if !$args{sortby} || $args{sortby} !~ /^[\w_.]+$/; 2594 2595 $args{offset} = 0 if !$args{offset} || $args{offset} !~ /^(?:all|\d+)$/; 2595 2596 … … 2826 2827 2827 2828 # protection against bad or missing arguments 2828 $args{sortorder} = 'ASC' if !$args{sortorder} ;2829 $args{sortby} = 'u.username' if !$args{sortby} ;2829 $args{sortorder} = 'ASC' if !$args{sortorder} || !grep /^$args{sortorder}$/, ('ASC','DESC'); 2830 $args{sortby} = 'u.username' if !$args{sortby} || $args{sortby} !~ /^[\w_.]+$/; 2830 2831 $args{offset} = 0 if !$args{offset} || $args{offset} !~ /^(?:all|\d+)$/; 2831 2832 … … 3293 3294 3294 3295 # protection against bad or missing arguments 3295 $args{sortorder} = 'ASC' if !$args{sortorder} ;3296 $args{sortby} = 'l.description' if !$args{sortby} ;3296 $args{sortorder} = 'ASC' if !$args{sortorder} || !grep /^$args{sortorder}$/, ('ASC','DESC'); 3297 $args{sortby} = 'l.description' if !$args{sortby} || $args{sortby} !~ /^[\w_.]+$/; 3297 3298 $args{offset} = 0 if !$args{offset} || $args{offset} !~ /^(?:all|\d+)$/; 3298 3299 … … 3495 3496 3496 3497 # protection against bad or missing arguments 3497 $args{sortorder} = 'ASC' if !$args{sortorder}; 3498 $args{sortby} = 'host' if !$args{sortby} && $args{revrec} eq 'n'; # default sort by host on domain record list 3499 $args{sortby} = 'val' if !$args{sortby} && $args{revrec} eq 'y'; # default sort by IP on revzone record list 3498 $args{sortorder} = 'ASC' if !$args{sortorder} || !grep /^$args{sortorder}$/, ('ASC','DESC'); 3499 my $defsort = 'host' if $args{revrec} eq 'n'; # default sort by host on domain record list 3500 my $defsort = 'val' if $args{revrec} eq 'y'; # default sort by IP on revzone record list 3501 $args{sortby} = $defsort if !$args{revrec}; 3502 $args{sortby} = $defsort if $args{sortby} !~ /^[\w_.]+$/; 3500 3503 $args{offset} = 0 if !$args{offset} || $args{offset} !~ /^(?:all|\d+)$/; 3501 3504 my $perpage = ($args{nrecs} ? $args{nrecs} : $config{perpage}); … … 4051 4054 4052 4055 # Sorting defaults 4053 $args{sort by} = 'stamp' if !$args{sortby};4054 $args{sort order} = 'DESC' if !$args{sortorder};4056 $args{sortorder} = 'DESC' if !$args{sortorder} || !grep /^$args{sortorder}$/, ('ASC','DESC'); 4057 $args{sortby} = 'stamp' if !$args{sortby} || $args{sortby} !~ /^[\w_.]+$/; 4055 4058 $args{offset} = 0 if !$args{offset} || $args{offset} !~ /^(?:all|\d+)$/; 4056 4059
Note:
See TracChangeset
for help on using the changeset viewer.