From 14a992f3f26e6c58003a729a6773bb0902ba431e Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Mon, 15 May 2006 23:06:59 +0000 Subject: Bug 303709: Eliminate deprecated Bugzilla::DB routines from sendbugmail.pl, sendunsentbugmail.pl and syncLDAP.pl scripts in contrib - Patch by Olav Vitters r=LpSolit a=justdave --- contrib/sendbugmail.pl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'contrib/sendbugmail.pl') 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(); } -- cgit v1.2.3-24-g4f1b