diff options
Diffstat (limited to 'attachment.cgi')
-rwxr-xr-x | attachment.cgi | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/attachment.cgi b/attachment.cgi index 0b389501b..17846866f 100755 --- a/attachment.cgi +++ b/attachment.cgi @@ -207,12 +207,10 @@ sub attachmentIsPublic { # Validates format of a diff/interdiff. Takes a list as an parameter, which # defines the valid format values. Will throw an error if the format is not # in the list. Returns either the user selected or default format. -sub validateFormat -{ +sub validateFormat { # receives a list of legal formats; first item is a default my $format = $cgi->param('format') || $_[0]; - if ( lsearch(\@_, $format) == -1) - { + if (not grep($_ eq $format, @_)) { ThrowUserError("invalid_format", { format => $format, formats => \@_ }); } |