summaryrefslogtreecommitdiffstats
path: root/process_bug.cgi
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-05-04 03:44:53 +0200
committerlpsolit%gmail.com <>2005-05-04 03:44:53 +0200
commite51425da1f1fe8ee831bfb8d4c091d9e08ae4dce (patch)
treef00cb30677e4c5759ca91186bf9bfd113baa88af /process_bug.cgi
parent3f138672bdd7fd4aba0b5c78b3541138174bd9f0 (diff)
downloadbugzilla-e51425da1f1fe8ee831bfb8d4c091d9e08ae4dce.tar.gz
bugzilla-e51425da1f1fe8ee831bfb8d4c091d9e08ae4dce.tar.xz
Bug 248386: Add support for Alias to post_bug.cgi - Patch by Albert Ting <altlst@sonic.net> r=LpSolit a=justdave
Diffstat (limited to 'process_bug.cgi')
-rwxr-xr-xprocess_bug.cgi38
1 files changed, 4 insertions, 34 deletions
diff --git a/process_bug.cgi b/process_bug.cgi
index b62271e8b..6eb82fc5a 100755
--- a/process_bug.cgi
+++ b/process_bug.cgi
@@ -768,47 +768,17 @@ if (Param("usebugaliases") && defined $cgi->param('alias')) {
# for one bug at a time, so ignore the alias change unless only a single
# bug is being changed.
if (scalar(@idlist) == 1) {
- # Validate the alias if the user entered one.
- if ($alias ne "") {
- # Make sure the alias isn't too long.
- if (length($alias) > 20) {
- ThrowUserError("alias_too_long");
- }
-
- # Make sure the alias is unique.
- my $escaped_alias = SqlQuote($alias);
- my $vars = { alias => $alias };
-
- SendSQL("SELECT bug_id FROM bugs WHERE alias = $escaped_alias " .
- "AND bug_id != $idlist[0]");
- my $id = FetchOneColumn();
-
- if ($id) {
- $vars->{'bug_link'} = GetBugLink($id, "Bug $id");
- ThrowUserError("alias_in_use", $vars);
- }
-
- # Make sure the alias isn't just a number.
- if ($alias =~ /^\d+$/) {
- ThrowUserError("alias_is_numeric", $vars);
- }
-
- # Make sure the alias has no commas or spaces.
- if ($alias =~ /[, ]/) {
- ThrowUserError("alias_has_comma_or_space", $vars);
- }
- }
-
# Add the alias change to the query. If the field contains the blank
# value, make the field be NULL to indicate that the bug has no alias.
# Otherwise, if the field contains a value, update the record
# with that value.
DoComma();
$::query .= "alias = ";
- if ($alias eq "") {
- $::query .= "NULL";
+ if ($alias ne "") {
+ ValidateBugAlias($alias, $idlist[0]);
+ $::query .= $dbh->quote($alias);
} else {
- $::query .= SqlQuote($alias);
+ $::query .= "NULL";
}
}
}