summaryrefslogtreecommitdiffstats
path: root/attachment.cgi
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-06-04 05:06:36 +0200
committerlpsolit%gmail.com <>2006-06-04 05:06:36 +0200
commit1d6499d6c8d9ce69914fbe9258868f2ef30a6177 (patch)
tree12d25cd576b3bb32cdef27ed1d64f61a9af3492d /attachment.cgi
parent623aee25de2e1ee758aae7124d451b3be469a233 (diff)
downloadbugzilla-1d6499d6c8d9ce69914fbe9258868f2ef30a6177.tar.gz
bugzilla-1d6499d6c8d9ce69914fbe9258868f2ef30a6177.tar.xz
Bug 340139: When adding a new attachment, data inserted in the bugs_activity table are quoted - Patch by Frédéric Buclin <LpSolit@gmail.com> r=bkor, r=ghendricks, r=vladd a=justdave
Diffstat (limited to 'attachment.cgi')
-rwxr-xr-xattachment.cgi23
1 files changed, 7 insertions, 16 deletions
diff --git a/attachment.cgi b/attachment.cgi
index bbccbd912..087b267e1 100755
--- a/attachment.cgi
+++ b/attachment.cgi
@@ -1075,15 +1075,12 @@ sub insert
# Make sure the person we are taking the bug from gets mail.
$owner = $oldvalues[4];
-
- @oldvalues = map($dbh->quote($_), @oldvalues);
- @newvalues = map($dbh->quote($_), @newvalues);
-
+
# Update the bug record. Note that this doesn't involve login_name.
- $dbh->do("UPDATE bugs SET delta_ts = ?, " .
- join(", ", map("$fields[$_] = $newvalues[$_]", (0..3))) .
- " WHERE bug_id = ?", undef, ($timestamp, $bugid));
-
+ $dbh->do('UPDATE bugs SET delta_ts = ?, ' .
+ join(', ', map("$fields[$_] = ?", (0..3))) . ' WHERE bug_id = ?',
+ undef, ($timestamp, map($newvalues[$_], (0..3)) , $bugid));
+
# If the bug was a dupe, we have to remove its entry from the
# 'duplicates' table.
$dbh->do('DELETE FROM duplicates WHERE dupe = ?', undef, $bugid);
@@ -1091,17 +1088,11 @@ sub insert
# We store email addresses in the bugs_activity table rather than IDs.
$oldvalues[0] = $oldvalues[4];
$newvalues[0] = $newvalues[4];
-
- # Add the changes to the bugs_activity table
- my $sth = $dbh->prepare("INSERT INTO bugs_activity
- (bug_id, who, bug_when, fieldid, removed, added)
- VALUES (?,?,?,?,?,?)");
for (my $i = 0; $i < 4; $i++) {
if ($oldvalues[$i] ne $newvalues[$i]) {
- my $fieldid = get_field_id($fields[$i]);
- $sth->execute($bugid, $userid, $timestamp,
- $fieldid, $oldvalues[$i], $newvalues[$i]);
+ LogActivityEntry($bugid, $fields[$i], $oldvalues[$i],
+ $newvalues[$i], $userid, $timestamp);
}
}
}