commit fe942a13891f7a0fbe7432b0c50ed2f6767d7267
parent 817ba7177d739b2d62ce7ca9872b4c1d6238b769
Author: René Wagner <rwagner@rw-net.de>
Date: Mon, 17 Aug 2020 18:35:46 +0200
validate order param values
Diffstat:
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/phosta.pl b/phosta.pl
@@ -68,12 +68,18 @@ sub validate
{
foreach (split (/,/, $opt_s))
{
- if ( ! ($_ ~~ @select_params) ) { return 0; }
+ if ( !($_ ~~ @select_params) ) { return 0; }
}
}
- #if (defined($opt_o) && !($opt_o ~~ @select_params) && !($opt_o ~~ @group_params)) { return 0; };
-
+ my @order_params = (@group_params, @select_params, 'count');
+ if (defined($opt_o))
+ {
+ foreach (split (/,/, $opt_o))
+ {
+ if ( !($_ ~~ @order_params)) { return 0; };
+ }
+ }
if (defined($opt_n) && (!looks_like_number($opt_n) || $opt_n < 1)) { return 0; }
if (defined($opt_t) && $opt_t !~ /^([0-9]{8}){0,1}\-([0-9]{8}){0,1}$/) { return 0; }