Bug 1044701: "Uninitialized value $token_type" when passing an invalid Bugzilla_api_token value

r=sgreen,a=glob


git-svn-id: svn://10.0.0.236/trunk@265484 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzrmirror%bugzilla.org 2014-07-31 17:30:50 +00:00
parent 3b5408996c
commit 6d369bd4e4
3 changed files with 6 additions and 3 deletions

View File

@ -1 +1 @@
9094 9095

View File

@ -1 +1 @@
8770b2cb9cbbb61c1eae54c9ce1f564f9d350044 88db66c588e8c411daffb13b53e4a1f5f259dc48

View File

@ -57,7 +57,10 @@ sub get_login_info {
my $api_token = Bugzilla->input_params->{Bugzilla_api_token}; my $api_token = Bugzilla->input_params->{Bugzilla_api_token};
my ($token_user_id, undef, undef, $token_type) my ($token_user_id, undef, undef, $token_type)
= Bugzilla::Token::GetTokenData($api_token); = Bugzilla::Token::GetTokenData($api_token);
if ($token_type ne 'api_token' || $user_id != $token_user_id) { if (!defined $token_type
|| $token_type ne 'api_token'
|| $user_id != $token_user_id)
{
ThrowUserError('auth_invalid_token', { token => $api_token }); ThrowUserError('auth_invalid_token', { token => $api_token });
} }
} }