summaryrefslogtreecommitdiffstats
path: root/contrib/sendbugmail.pl
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-05-16 01:06:59 +0200
committerlpsolit%gmail.com <>2006-05-16 01:06:59 +0200
commit14a992f3f26e6c58003a729a6773bb0902ba431e (patch)
tree4458f842d3dd8296f1b00cd6605b9a1293557711 /contrib/sendbugmail.pl
parentea5339f6b43fc25894639b57a8af6819b7f4e079 (diff)
downloadbugzilla-14a992f3f26e6c58003a729a6773bb0902ba431e.tar.gz
bugzilla-14a992f3f26e6c58003a729a6773bb0902ba431e.tar.xz
Bug 303709: Eliminate deprecated Bugzilla::DB routines from sendbugmail.pl, sendunsentbugmail.pl and syncLDAP.pl scripts in contrib - Patch by Olav Vitters <bugzilla-mozilla@bkor.dhs.org> r=LpSolit a=justdave
Diffstat (limited to 'contrib/sendbugmail.pl')
-rw-r--r--contrib/sendbugmail.pl10
1 files changed, 7 insertions, 3 deletions
diff --git a/contrib/sendbugmail.pl b/contrib/sendbugmail.pl
index ad9642895..5e7cda696 100644
--- a/contrib/sendbugmail.pl
+++ b/contrib/sendbugmail.pl
@@ -4,7 +4,7 @@
#
# Nick Barnes, Ravenbrook Limited, 2004-04-01.
#
-# $Id: sendbugmail.pl,v 1.3 2005/02/24 23:42:48 mkanat%kerio.com Exp $
+# $Id: sendbugmail.pl,v 1.4 2006/05/15 16:06:59 lpsolit%gmail.com Exp $
#
# Bugzilla email script for Bugzilla 2.17.4 and later. Invoke this to send
# bugmail for a bug which has been changed directly in the database.
@@ -17,9 +17,12 @@
use lib qw(.);
require "globals.pl";
+use Bugzilla;
use Bugzilla::BugMail;
use Bugzilla::User;
+my $dbh = Bugzilla->dbh;
+
sub usage {
print STDERR "Usage: $0 bug_id user_email\n";
exit;
@@ -41,9 +44,10 @@ if (!($bugnum =~ /^(\d+)$/)) {
detaint_natural($bugnum);
-SendSQL("SELECT bug_id FROM bugs WHERE bug_id = $bugnum");
+my ($id) = $dbh->selectrow_array("SELECT bug_id FROM bugs WHERE bug_id = ?",
+ undef, $bugnum);
-if (!FetchOneColumn()) {
+if (!$id) {
print STDERR "Bug number $bugnum does not exist.\n";
usage();
}