summaryrefslogtreecommitdiffstats
path: root/Bugzilla/WebService
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2015-05-26 17:59:57 +0200
committerByron Jones <glob@mozilla.com>2015-05-26 17:59:57 +0200
commitf8b984852ae27f14a5f44e651193f00977737ab1 (patch)
tree7b7d631f17fa9b82844f0db79b605f157fa48e2c /Bugzilla/WebService
parent95e71eea95c977eb7512156be813ede7eb161600 (diff)
downloadbugzilla-f8b984852ae27f14a5f44e651193f00977737ab1.tar.gz
bugzilla-f8b984852ae27f14a5f44e651193f00977737ab1.tar.xz
Bug 1146782: backport bug 1159589 to bmo (migrate autocomplete from yui to jquery)
Diffstat (limited to 'Bugzilla/WebService')
-rw-r--r--Bugzilla/WebService/User.pm11
1 files changed, 7 insertions, 4 deletions
diff --git a/Bugzilla/WebService/User.pm b/Bugzilla/WebService/User.pm
index 8948a0195..8592d809c 100644
--- a/Bugzilla/WebService/User.pm
+++ b/Bugzilla/WebService/User.pm
@@ -27,7 +27,7 @@ use Bugzilla::Constants;
use Bugzilla::Error;
use Bugzilla::Group;
use Bugzilla::User;
-use Bugzilla::Util qw(trim);
+use Bugzilla::Util qw(trim detaint_natural);
use Bugzilla::WebService::Util qw(filter filter_wants validate
translate params_to_objects);
use Bugzilla::Hook;
@@ -207,11 +207,14 @@ sub get {
userid => $obj->id});
}
}
-
+
# User Matching
my $limit;
- if ($params->{'maxusermatches'}) {
- $limit = $params->{'maxusermatches'} + 1;
+ if ($params->{limit}) {
+ detaint_natural($params->{limit})
+ || ThrowCodeError('param_must_be_numeric',
+ { function => 'User.match', param => 'limit' });
+ $limit = $limit ? min($params->{limit}, $limit) : $params->{limit};
}
my $exclude_disabled = $params->{'include_disabled'} ? 0 : 1;
foreach my $match_string (@{ $params->{'match'} || [] }) {