summaryrefslogtreecommitdiffstats
path: root/checksetup.pl
diff options
context:
space:
mode:
authormyk%mozilla.org <>2001-08-20 03:26:21 +0200
committermyk%mozilla.org <>2001-08-20 03:26:21 +0200
commit5391f72b57b6bcecdc6349981eaf879917646c16 (patch)
tree4e8de3db08721c4e3e69edbc763018483e166668 /checksetup.pl
parent19fac474c4e5c37062fe55633943846430ef549f (diff)
downloadbugzilla-5391f72b57b6bcecdc6349981eaf879917646c16.tar.gz
bugzilla-5391f72b57b6bcecdc6349981eaf879917646c16.tar.xz
Fix for bug 95890: Correctly convert/record keyword changes in the bugs_activity table for keywords containing a plus sign or other
regular expression meta-characters. Myk's first ever Bugzilla checkin! Patch by Dave Miller <justdave@syndicomm.com> and Myk Melez <myk@mozilla.org>. r=myk@mozilla.org,justdave@syndicomm.com
Diffstat (limited to 'checksetup.pl')
-rwxr-xr-xchecksetup.pl16
1 files changed, 9 insertions, 7 deletions
diff --git a/checksetup.pl b/checksetup.pl
index 4eeec8ef1..4c3ab81d3 100755
--- a/checksetup.pl
+++ b/checksetup.pl
@@ -2405,25 +2405,27 @@ if (GetFieldDef('bugs_activity', 'oldvalue')) {
oldvalue, newvalue FROM bugs_activity");
$sth->execute;
while (my ($bug_id, $who, $bug_when, $fieldid, $oldvalue, $newvalue) = $sth->fetchrow_array()) {
- # print a "." every 500 records so the user knows we didn't die
- print "." if !($i++ % 500);
+ # print the iteration count every 500 records so the user knows we didn't die
+ print "$i..." if !($i++ % 500);
# Make sure (old|new)value isn't null (to suppress warnings)
$oldvalue ||= "";
$newvalue ||= "";
my ($added, $removed) = "";
- if (grep /^$fieldid$/, @multi) {
+ if (grep ($_ eq $fieldid, @multi)) {
+ $oldvalue =~ s/[\s,]+/ /g;
+ $newvalue =~ s/[\s,]+/ /g;
+ my @old = split(" ", $oldvalue);
+ my @new = split(" ", $newvalue);
my (@add, @remove) = ();
- my @old = split(/[ ,]/, $oldvalue);
- my @new = split(/[ ,]/, $newvalue);
# Find values that were "added"
foreach my $value(@new) {
- if (! grep /^$value$/, @old) {
+ if (! grep ($_ eq $value, @old)) {
push (@add, $value);
}
}
# Find values that were removed
foreach my $value(@old) {
- if (! grep /^$value$/, @new) {
+ if (! grep ($_ eq $value, @new)) {
push (@remove, $value);
}
}