]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 348529: Editing keywords results in a "Software Error"
authormkanat%bugzilla.org <>
Tue, 15 Aug 2006 01:10:13 +0000 (01:10 +0000)
committermkanat%bugzilla.org <>
Tue, 15 Aug 2006 01:10:13 +0000 (01:10 +0000)
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=justdave

editkeywords.cgi

index 7b94dbbe399ea4771a65d23eb5130b8d1f3a503d..f2403c3720cc2d3b1935aaf100922de0162f590b 100755 (executable)
@@ -34,6 +34,25 @@ my $dbh = Bugzilla->dbh;
 my $template = Bugzilla->template;
 my $vars = {};
 
+sub Validate {
+    my ($name, $description) = @_;
+    if ($name eq "") {
+        ThrowUserError("keyword_blank_name");
+    }
+    if ($name =~ /[\s,]/) {
+        ThrowUserError("keyword_invalid_name");
+    }    
+    if ($description eq "") {
+        ThrowUserError("keyword_blank_description");
+    }
+    # It is safe to detaint these values as they are only
+    # used in placeholders.
+    trick_taint($name);
+    $_[0] = $name;
+    trick_taint($description);
+    $_[1] = $description;
+}
+
 sub ValidateKeyID {
     my $id = shift;