]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 197180 - Long comment names not flagged as an error
authorbbaetz%acm.org <>
Sun, 16 Mar 2003 14:16:43 +0000 (14:16 +0000)
committerbbaetz%acm.org <>
Sun, 16 Mar 2003 14:16:43 +0000 (14:16 +0000)
r,a=justdave

editcomponents.cgi

index fc45b52c8ba2138eb4eb46fefeb55e9f804ddf41..4ee147453fd4c3b17a054847da24f27e523b1fbc 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=64 NAME=\"component\" VALUE=\"" .
         value_quote($component) . "\">\n";
     print "      <INPUT TYPE=HIDDEN NAME=\"product\" VALUE=\"" .
         value_quote($product) . "\"></TD>\n";
@@ -386,6 +386,12 @@ if ($action eq 'new') {
         exit;
     }
 
+    if (length($component) > 64) {
+        print "Sorry, the name of a component is limited to 64 characters.";
+        PutTrailer($localtrailer);
+        exit;
+    }
+
     my $description = trim($::FORM{description} || '');
 
     if ($description eq '') {
@@ -710,6 +716,12 @@ if ($action eq 'update') {
     my $initialqacontact    = trim($::FORM{initialqacontact}    || '');
     my $initialqacontactold = trim($::FORM{initialqacontactold} || '');
 
+    if (length($component) > 64) {
+        print "Sorry, the name of a component is limited to 64 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'