diff options
Diffstat (limited to 'Bugzilla/Template.pm')
-rw-r--r-- | Bugzilla/Template.pm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index da46774a1..a4e250cfc 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -55,6 +55,7 @@ use File::Find; use File::Path qw(rmtree mkpath); use File::Spec; use IO::Dir; +use List::MoreUtils qw(firstidx); use Scalar::Util qw(blessed); use base qw(Template); @@ -716,7 +717,10 @@ sub create { 'time2str' => \&Date::Format::time2str, # Generic linear search function - 'lsearch' => \&Bugzilla::Util::lsearch, + 'lsearch' => sub { + my ($array, $item) = @_; + return firstidx { $_ eq $item } @$array; + }, # Currently logged in user, if any # If an sudo session is in progress, this is the user we're faking |