diff options
author | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-04-22 11:02:17 -0700 |
---|---|---|
committer | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-04-22 11:02:17 -0700 |
commit | 271477d8c26794abd8310e2abb89b746204660af (patch) | |
tree | a4701a52f9ff1918e25a75e09267bfba0b063296 /attachment.cgi | |
parent | The maintainer of MIME::tools released a new version that now supports (diff) | |
download | bugzilla-271477d8c26794abd8310e2abb89b746204660af.tar.gz bugzilla-271477d8c26794abd8310e2abb89b746204660af.tar.bz2 bugzilla-271477d8c26794abd8310e2abb89b746204660af.zip |
Bug 560009: Use firstidx from List::MoreUtils instead of lsearch
r=timello, a=mkanat
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 => \@_ }); } |