remove brackets from conditions that are not needed
This commit is contained in:
@@ -103,7 +103,7 @@ sub get_calendar($$$) {
|
||||
my $debug = $config->{system}->{debug};
|
||||
|
||||
$request->{params}->{original}->{template} = 'calendar.html';
|
||||
$request->{params}->{original}->{date} = $date if ( defined $date );
|
||||
$request->{params}->{original}->{date} = $date if defined $date;
|
||||
$request->{params}->{checked} = calendar::check_params( $config, $request->{params}->{original} );
|
||||
$params = $request->{params}->{checked};
|
||||
|
||||
|
||||
@@ -71,14 +71,14 @@ sub extractEventFromWikiText($;$) {
|
||||
$category =~ s/\s+/ /g;
|
||||
$category =~ s/^\s+|\s+$//g;
|
||||
$category =~ s/\&/\+/g;
|
||||
push @categories, $category if ( defined $category && $category =~ /\S/ );
|
||||
push @categories, $category if defined $category && $category =~ /\S/;
|
||||
|
||||
$category = '';
|
||||
$category = $2 if ( defined $2 );
|
||||
$category =~ s/\s+/ /g;
|
||||
$category =~ s/^\s+|\s+$//g;
|
||||
$category =~ s/\&/\+/g;
|
||||
push @categories, $category if ( defined $category && $category =~ /\S/ );
|
||||
push @categories, $category if defined $category && $category =~ /\S/;
|
||||
$title =~ s/\((.*?),(.*?)\)/\($2\)/;
|
||||
}
|
||||
if ( $title =~ /\((.*?)\)/ ) {
|
||||
@@ -87,7 +87,7 @@ sub extractEventFromWikiText($;$) {
|
||||
$category =~ s/^\s+|\s+$//g;
|
||||
$category =~ s/\&/\+/g;
|
||||
|
||||
push @categories, $category if ( defined $category && $category =~ /\S/ );
|
||||
push @categories, $category if defined $category && $category =~ /\S/;
|
||||
$title =~ s/\((.*?)\)//;
|
||||
}
|
||||
$event->{categories} = \@categories if ( @categories > 0 );
|
||||
|
||||
@@ -371,7 +371,7 @@ sub modify_results ($$$$) {
|
||||
)
|
||||
{
|
||||
for my $key ( keys %$result ) {
|
||||
$result->{$key} =~ s/\|/\\\|/g if ( defined $result->{$key} );
|
||||
$result->{$key} =~ s/\|/\\\|/g if defined $result->{$key};
|
||||
}
|
||||
|
||||
# $result->{content}='no';
|
||||
|
||||
@@ -31,7 +31,7 @@ sub get($$) {
|
||||
my $language = undef;
|
||||
|
||||
#get language from options
|
||||
$language = $options->{language} if ( defined $options->{language} );
|
||||
$language = $options->{language} if defined $options->{language};
|
||||
|
||||
#get language from user
|
||||
if ( ( !( defined $language ) ) && ( defined $options->{user} ) ) {
|
||||
|
||||
@@ -107,7 +107,7 @@ sub get_user($) {
|
||||
|
||||
my $user = $ENV{REMOTE_USER};
|
||||
my $users = $config->{users};
|
||||
return $user if ( defined $users->{$user} );
|
||||
return $user if defined $users->{$user};
|
||||
return 'nobody';
|
||||
}
|
||||
|
||||
|
||||
@@ -426,12 +426,12 @@ sub search_events ($$$) {
|
||||
template => 'no'
|
||||
};
|
||||
if ( defined $options ) {
|
||||
$params->{from_date} = $options->{from_date} if ( defined $options->{from_date} );
|
||||
$params->{till_date} = $options->{till_date} if ( defined $options->{till_date} );
|
||||
$params->{location} = $options->{location} if ( defined $options->{location} );
|
||||
$params->{limit} = $options->{limit} if ( defined $options->{limit} );
|
||||
$params->{archive} = $options->{archive} if ( defined $options->{archive} );
|
||||
$params->{get} = $options->{get} if ( defined $options->{get} );
|
||||
$params->{from_date} = $options->{from_date} if defined $options->{from_date};
|
||||
$params->{till_date} = $options->{till_date} if defined $options->{till_date};
|
||||
$params->{location} = $options->{location} if defined $options->{location};
|
||||
$params->{limit} = $options->{limit} if defined $options->{limit};
|
||||
$params->{archive} = $options->{archive} if defined $options->{archive};
|
||||
$params->{get} = $options->{get} if defined $options->{get};
|
||||
}
|
||||
|
||||
my $checked_params = events::check_params( $config, $params );
|
||||
|
||||
Reference in New Issue
Block a user