]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 515568: handle_login() doesn't check $@ after eval
authorFrédéric Buclin <LpSolit@gmail.com>
Sat, 6 Feb 2010 18:04:07 +0000 (19:04 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Sat, 6 Feb 2010 18:04:07 +0000 (19:04 +0100)
r/a=mkanat

Bugzilla/WebService/Constants.pm
Bugzilla/WebService/Server.pm
template/en/default/global/code-error.html.tmpl

index e47beb1f26555c888d79501bb6489d25b6b9f4b4..4ecb200958943a1984dd428cda7a495741449467 100644 (file)
@@ -112,6 +112,8 @@ use constant WS_ERROR_CODE => {
     invalid_user_group    => 504,
     user_access_by_id_denied    => 505,
     user_access_by_match_denied => 505,
+    # Fatal errors (must be negative).
+    unknown_method              => -32601,
 };
 
 # These are the fallback defaults for errors not in ERROR_CODE.
index dfb9f559a104a803368a54b781bcecf86ab8033f..ffc54c612a7ce4077da3f7e3700f97c894ee2433 100644 (file)
 package Bugzilla::WebService::Server;
 use strict;
 use Bugzilla::Util qw(ssl_require_redirect);
+use Bugzilla::Error;
 
 sub handle_login {
     my ($self, $class, $method, $full_method) = @_;
     eval "require $class";
+    ThrowCodeError('unknown_method', {method => $full_method}) if $@;
     return if $class->login_exempt($method);
     Bugzilla->login();
 
index 626ad500828e8dc46c5ecfa7504141e8f37a91d6..4f5ba27f447dc8edc55d9eacd833bd5e7ed6f4cd 100644 (file)
        I could not figure out what you wanted to do.
     [% END %]
 
+  [% ELSIF error == "unknown_method" %]
+    The requested method '[% method FILTER html %]' was not found.
+
   [% ELSIF error == "usage_mode_invalid" %]
     '[% invalid_usage_mode FILTER html %]' is not a valid usage mode.