set parameter strings with entry::set_strings

This commit is contained in:
Milan
2020-03-08 14:16:58 +01:00
parent 94d4ca59d8
commit 07219ad3ee
4 changed files with 19 additions and 65 deletions

View File

@@ -392,22 +392,12 @@ sub check_params {
$checked->{create_events} = 0;
$checked->{publish_events} = 0;
}
for my $param ( 'frequency', 'duration', 'default_duration', 'create_events', 'publish_events', 'live',
'count_episodes' )
{
if ( ( defined $params->{$param} ) && ( $params->{$param} =~ /(\d+)/ ) ) {
$checked->{$param} = $1;
}
}
entry::set_numbers( $checked, $params, [
'frequency', 'duration', 'default_duration', 'create_events', 'publish_events', 'live']);
#scalars
for my $param ( 'search', 'from', 'till' ) {
if ( defined $params->{$param} ) {
$checked->{$param} = $params->{$param};
$checked->{$param} =~ s/^\s+//g;
$checked->{$param} =~ s/\s+$//g;
}
}
entry::set_strings( $checked, $params,
[ 'search', 'from', 'till' ]);
return $checked;
}