From: mkanat%bugzilla.org <> Date: Tue, 15 Aug 2006 01:10:13 +0000 (+0000) Subject: Bug 348529: Editing keywords results in a "Software Error" X-Git-Tag: bugzilla-2.23.3~159 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=10ece7637657f06eea27bb1ab06da35ca8a78765;p=thirdparty%2Fbugzilla.git Bug 348529: Editing keywords results in a "Software Error" Patch By Max Kanat-Alexander r=LpSolit, a=justdave --- diff --git a/editkeywords.cgi b/editkeywords.cgi index 7b94dbbe39..f2403c3720 100755 --- a/editkeywords.cgi +++ b/editkeywords.cgi @@ -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;