From: mkanat%kerio.com <> Date: Fri, 18 Mar 2005 12:21:27 +0000 (+0000) Subject: Bug 256513: Fix usage of grep (/$value/, @array); X-Git-Tag: bugzilla-2.19.3~119 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b990337deb4528ad6a956d3c3d37be80151d06e;p=thirdparty%2Fbugzilla.git Bug 256513: Fix usage of grep (/$value/, @array); Patch By Olav Vitters r=mkanat, a=justdave --- diff --git a/Bugzilla/DB.pm b/Bugzilla/DB.pm index d84ce873d1..292925a6ff 100644 --- a/Bugzilla/DB.pm +++ b/Bugzilla/DB.pm @@ -312,7 +312,7 @@ sub bz_setup_database { my @desired_tables = $self->_bz_schema->get_table_list(); foreach my $table_name (@desired_tables) { - next if grep /^$table_name$/, @current_tables; + next if grep($_ eq $table_name, @current_tables); print "Creating table $table_name ...\n"; my @table_sql = $self->_bz_schema->get_table_ddl($table_name); diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index 3e37ed5e75..29ed2924c1 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -117,7 +117,7 @@ sub getTemplateIncludePath () { # 'en-uk' etc. but not the otherway round. (This is unfortunally # not very clearly stated in those RFC; see comment just over 14.5 # in http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4) - if(my @found = grep /^$lang(-.+)?$/i, @languages) { + if(my @found = grep /^\Q$lang\E(-.+)?$/i, @languages) { push (@usedlanguages, @found); } } diff --git a/checksetup.pl b/checksetup.pl index 51a264391e..08771fb439 100755 --- a/checksetup.pl +++ b/checksetup.pl @@ -773,7 +773,7 @@ if ($my_webservergroup && !$silent) { # that we can't chgrp to my $webservergid = (getgrnam($my_webservergroup))[2] or die("no such group: $my_webservergroup"); - if ($< != 0 && !grep(/^$webservergid$/, split(" ", $)))) { + if ($< != 0 && !grep($_ eq $webservergid, split(" ", $)))) { print <