]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 302936: Reject the requestee if he cannot access private attachments - Patch...
authorlpsolit%gmail.com <>
Wed, 19 Oct 2005 00:45:47 +0000 (00:45 +0000)
committerlpsolit%gmail.com <>
Wed, 19 Oct 2005 00:45:47 +0000 (00:45 +0000)
Bugzilla/Flag.pm
Bugzilla/FlagType.pm
attachment.cgi

index 34ded7dd2224e5b8d5d4a8902473f539c4ce81e6..54a8bea80f3e821b2e6e329132af8150b2e47df9 100644 (file)
@@ -228,10 +228,13 @@ sub count {
 
 =over
 
-=item C<validate($cgi, $bug_id)>
+=item C<validate($cgi, $bug_id, $attach_id)>
 
 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
index a7a32c5ccbd0c18d706d5d18832fba199b3c535b..950aeea9a09d13af9e0d131f145398217de6f5cb 100644 (file)
@@ -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
index 6670e6325a1aae75bdf4dc3bd88e10cc1032ca53..3aa1a68d6138f9b1edb082c7baec8cbfa97a119a 100755 (executable)
@@ -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);