summaryrefslogtreecommitdiffstats
path: root/CGI.pl
diff options
context:
space:
mode:
authormkanat%kerio.com <>2005-03-09 08:03:57 +0100
committermkanat%kerio.com <>2005-03-09 08:03:57 +0100
commit3a92f2d18482834d9f51852c3809b687452fea0e (patch)
tree066bef1a71986891510d4f04d7228843e2107258 /CGI.pl
parent642af3b414b8f4135170ca03ee7d0dedc49a9c13 (diff)
downloadbugzilla-3a92f2d18482834d9f51852c3809b687452fea0e.tar.gz
bugzilla-3a92f2d18482834d9f51852c3809b687452fea0e.tar.xz
Bug 283919: Move BugAliasToID out of CGI.pl into Bugzilla::Bug
Patch By Max Kanat-Alexander <mkanat@kerio.com> r=LpSolit, a=myk
Diffstat (limited to 'CGI.pl')
-rw-r--r--CGI.pl19
1 files changed, 2 insertions, 17 deletions
diff --git a/CGI.pl b/CGI.pl
index 652d6c03b..8d42eb4cc 100644
--- a/CGI.pl
+++ b/CGI.pl
@@ -45,6 +45,7 @@ use Bugzilla::Config;
use Bugzilla::Constants;
use Bugzilla::Error;
use Bugzilla::BugMail;
+use Bugzilla::Bug;
# Shut up misguided -w warnings about "used only once". For some reason,
# "use vars" chokes on me when I try it here.
@@ -127,22 +128,6 @@ sub CheckFormFieldDefined (\%$) {
}
}
-sub BugAliasToID {
- # Queries the database for the bug with a given alias, and returns
- # the ID of the bug if it exists or the undefined value if it doesn't.
-
- my ($alias) = @_;
-
- return undef unless Param("usebugaliases");
-
- PushGlobalSQLState();
- SendSQL("SELECT bug_id FROM bugs WHERE alias = " . SqlQuote($alias));
- my $id = FetchOneColumn();
- PopGlobalSQLState();
-
- return $id;
-}
-
sub ValidateBugID {
# Validates and verifies a bug ID, making sure the number is a
# positive integer, that it represents an existing bug in the
@@ -157,7 +142,7 @@ sub ValidateBugID {
# If the ID isn't a number, it might be an alias, so try to convert it.
my $alias = $id;
if (!detaint_natural($id)) {
- $id = BugAliasToID($alias);
+ $id = bug_alias_to_id($alias);
$id || ThrowUserError("invalid_bug_id_or_alias",
{'bug_id' => $alias,
'field' => $field });