summaryrefslogtreecommitdiffstats
path: root/Bugzilla/User.pm
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2009-12-10 23:18:05 +0100
committermkanat%bugzilla.org <>2009-12-10 23:18:05 +0100
commit59a35402749a8b20db50b810ce29c1479594dced (patch)
tree85f5c1fa1c4043dff77b2da71c0219c9bf2e6105 /Bugzilla/User.pm
parent56285b05dcdc9ebfe8df8119b387205def6db9dc (diff)
downloadbugzilla-59a35402749a8b20db50b810ce29c1479594dced.tar.gz
bugzilla-59a35402749a8b20db50b810ce29c1479594dced.tar.xz
Bug 526158: Make email_in.pl use Bugzilla::Bug->create to create bugs instead of requiring post_bug.cgi
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
Diffstat (limited to 'Bugzilla/User.pm')
-rw-r--r--Bugzilla/User.pm9
1 files changed, 8 insertions, 1 deletions
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');
}