From 59a35402749a8b20db50b810ce29c1479594dced Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Thu, 10 Dec 2009 22:18:05 +0000 Subject: Bug 526158: Make email_in.pl use Bugzilla::Bug->create to create bugs instead of requiring post_bug.cgi Patch by Max Kanat-Alexander r=LpSolit, a=LpSolit --- Bugzilla/User.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Bugzilla/User.pm') diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm index 7c458388c..3e6f3b6ba 100644 --- a/Bugzilla/User.pm +++ b/Bugzilla/User.pm @@ -716,7 +716,14 @@ sub can_enter_product { my $dbh = Bugzilla->dbh; $warn ||= 0; - if (!defined $input) { + $input = trim($input) if !ref $input; + if (!defined $input or $input eq '') { + return unless $warn == THROW_ERROR; + ThrowUserError('object_not_specified', + { class => 'Bugzilla::Product' }); + } + + if (!scalar @{ $self->get_enterable_products }) { return unless $warn == THROW_ERROR; ThrowUserError('no_products'); } -- cgit v1.2.3-24-g4f1b