now validates sort type
This commit is contained in:
parent
ea9728aecc
commit
92291a2aa9
|
@ -1,4 +1,7 @@
|
|||
Revision history for Parse-Netstat-Search-Sort
|
||||
|
||||
0.0.1 ?/?
|
||||
- Make sure it validates the sort type.
|
||||
|
||||
0.0.0 2019-02-25/02:30
|
||||
- Initial release.
|
||||
|
|
|
@ -12,11 +12,11 @@ Parse::Netstat::Search::Sort - Sorts the returned array from Parse::Netstat::Sea
|
|||
|
||||
=head1 VERSION
|
||||
|
||||
Version 0.0.0
|
||||
Version 0.0.1
|
||||
|
||||
=cut
|
||||
|
||||
our $VERSION = '0.0.0';
|
||||
our $VERSION = '0.0.1';
|
||||
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
@ -155,6 +155,13 @@ sub set_sort{
|
|||
$sort='host_f';
|
||||
}
|
||||
|
||||
if (! defined( $self->{sort_check}{$sort} ) ){
|
||||
$self->{error}=1;
|
||||
$self->{errorString}='"'.$sort.'" is not a valid sort type';
|
||||
$self->warn;
|
||||
return undef;
|
||||
}
|
||||
|
||||
$self->{sort}=$sort;
|
||||
|
||||
return 1;
|
||||
|
|
Loading…
Reference in New Issue