]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 197180 - long component name not flagged as error
authorbbaetz%acm.org <>
Sun, 16 Mar 2003 14:19:34 +0000 (14:19 +0000)
committerbbaetz%acm.org <>
Sun, 16 Mar 2003 14:19:34 +0000 (14:19 +0000)
Because of a mismatch between the size of bugs.component and
components.program, this caused silent failures when creating/moving bugs
in that component.
r/a=justdave

editcomponents.cgi

index 4f76593df6679b4c9283577d4176ed75925e9c66..1dc89925f0c6f6d11791e36ee1d9021c97d40683 100755 (executable)
@@ -123,7 +123,7 @@ sub EmitFormElements ($$$$$)
                                              $initialqacontactid ? DBID_to_name ($initialqacontactid) : '');
 
     print "  <TH ALIGN=\"right\">Component:</TH>\n";
-    print "  <TD><INPUT SIZE=64 MAXLENGTH=255 NAME=\"component\" VALUE=\"" .
+    print "  <TD><INPUT SIZE=64 MAXLENGTH=50 NAME=\"component\" VALUE=\"" .
         value_quote($component) . "\">\n";
     print "      <INPUT TYPE=HIDDEN NAME=\"product\" VALUE=\"" .
         value_quote($product) . "\"></TD>\n";
@@ -385,6 +385,11 @@ if ($action eq 'new') {
         PutTrailer($localtrailer);
         exit;
     }
+    if (length($component) > 50) {
+        print "Sorry, the name of a component is limited to 50 characters.";
+        PutTrailer($localtrailer);
+        exit;
+    }
 
     my $description = trim($::FORM{description} || '');
 
@@ -709,6 +714,12 @@ if ($action eq 'update') {
 
     CheckComponent($product,$componentold);
 
+    if (length($component) > 50) {
+        print "Sorry, the name of a component is limited to 50 characters.";
+        PutTrailer($localtrailer);
+        exit;
+    }
+
     # Note that the order of this tests is important. If you change
     # them, be sure to test for WHERE='$component' or WHERE='$componentold'