Skip to content

Commit

Permalink
Merge branch '5.0/allow-empty-search-result-page' into 5.0.3-releng
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrandtbuffalo committed Jul 13, 2022
2 parents 45c29dc + 46d2659 commit 850147a
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions lib/RT/Interface/Web.pm
Original file line number Diff line number Diff line change
Expand Up @@ -310,18 +310,16 @@ sub HandleRequest {
local $HTML::Mason::Commands::DECODED_ARGS = $ARGS;
PreprocessTimeUpdates($ARGS);

if ( exists $ARGS->{ResultPage} ) {
if ( defined $ARGS->{ResultPage} && length $ARGS->{ResultPage} ) {
my $passed;
if ( defined $ARGS->{ResultPage} && length $ARGS->{ResultPage} ) {
for my $item ( @RT::Interface::Web::WHITELISTED_RESULT_PAGES ) {
if ( ref $item eq 'Regexp' ) {
$passed = 1 if $ARGS->{ResultPage} =~ $item;
}
else {
$passed = 1 if $ARGS->{ResultPage} eq $item;
}
last if $passed;
for my $item (@RT::Interface::Web::WHITELISTED_RESULT_PAGES) {
if ( ref $item eq 'Regexp' ) {
$passed = 1 if $ARGS->{ResultPage} =~ $item;
}
else {
$passed = 1 if $ARGS->{ResultPage} eq $item;
}
last if $passed;
}

if ( !$passed ) {
Expand Down

0 comments on commit 850147a

Please sign in to comment.