From: lpsolit%gmail.com <> Date: Wed, 19 Oct 2005 00:45:47 +0000 (+0000) Subject: Bug 302936: Reject the requestee if he cannot access private attachments - Patch... X-Git-Tag: bugzilla-2.22rc1~213 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d67e86a56de870d2a76f0bc5d0dfa53af664a73;p=thirdparty%2Fbugzilla.git Bug 302936: Reject the requestee if he cannot access private attachments - Patch by Frédéric Buclin r=jouni a=justdave --- diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm index 34ded7dd22..54a8bea80f 100644 --- a/Bugzilla/Flag.pm +++ b/Bugzilla/Flag.pm @@ -228,10 +228,13 @@ sub count { =over -=item C +=item C Validates fields containing flag modifications. +If the attachment is new, it has no ID yet and $attach_id is set +to -1 to force its check anyway. + =back =cut diff --git a/Bugzilla/FlagType.pm b/Bugzilla/FlagType.pm index a7a32c5ccb..950aeea9a0 100644 --- a/Bugzilla/FlagType.pm +++ b/Bugzilla/FlagType.pm @@ -320,6 +320,9 @@ to extract flag type IDs from form field names by matching columns whose name looks like "flag_type-nnn", where "nnn" is the ID, and returning just the ID portion of matching field names. +If the attachment is new, it has no ID yet and $attach_id is set +to -1 to force its check anyway. + =back =cut diff --git a/attachment.cgi b/attachment.cgi index 6670e6325a..3aa1a68d61 100755 --- a/attachment.cgi +++ b/attachment.cgi @@ -937,11 +937,11 @@ sub insert $vars->{'message'} = 'user_match_multiple'; } - # Flag::validate() should not detect any reference to existing - # flags when creating a new attachment. Setting the third param - # to -1 will force this function to check this point. + # FlagType::validate() and Flag::validate() should not detect + # any reference to existing flags when creating a new attachment. + # Setting the third param to -1 will force this function to check this point. Bugzilla::Flag::validate($cgi, $bugid, -1); - Bugzilla::FlagType::validate($cgi, $bugid); + Bugzilla::FlagType::validate($cgi, $bugid, -1); # Escape characters in strings that will be used in SQL statements. my $sql_filename = SqlQuote($filename);