set parameter strings with entry::set_strings
This commit is contained in:
@@ -299,20 +299,11 @@ sub check_params {
|
||||
$checked->{create_events} = 0;
|
||||
$checked->{publish_events} = 0;
|
||||
}
|
||||
for my $param ( 'frequency', 'duration', 'default_duration' ) {
|
||||
if ( ( defined $params->{$param} ) && ( $params->{$param} =~ /(\d+)/ ) ) {
|
||||
$checked->{$param} = $1;
|
||||
}
|
||||
}
|
||||
entry::set_numbers( $checked, $params, [ 'frequency', 'duration', 'default_duration' ]);
|
||||
|
||||
#scalars
|
||||
for my $param ( 'from', 'till', 'period_type', 'type', 'title' ) {
|
||||
if ( defined $params->{$param} ) {
|
||||
$checked->{$param} = $params->{$param};
|
||||
$checked->{$param} =~ s/^\s+//g;
|
||||
$checked->{$param} =~ s/\s+$//g;
|
||||
}
|
||||
}
|
||||
entry::set_strings( $checked, $params,
|
||||
[ 'from', 'till', 'period_type', 'type', 'title' ]
|
||||
);
|
||||
|
||||
for my $attr ('start') {
|
||||
if ( ( defined $params->{$attr} ) && ( $params->{$attr} =~ /(\d\d\d\d\-\d\d\-\d\d[ T]\d\d\:\d\d)/ ) ) {
|
||||
|
||||
Reference in New Issue
Block a user