From 7b2e2ec40ef49e9a4963dad72892f0df21a74048 Mon Sep 17 00:00:00 2001 From: Guillaume Rousse <guillaume.rousse@renater.fr> Date: Fri, 3 Nov 2017 16:33:35 +0100 Subject: [PATCH] no need to store action, it is used only once --- lib/IdPAccountManager/WebRequest.pm | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/IdPAccountManager/WebRequest.pm b/lib/IdPAccountManager/WebRequest.pm index ed3c609..0bdc94b 100755 --- a/lib/IdPAccountManager/WebRequest.pm +++ b/lib/IdPAccountManager/WebRequest.pm @@ -101,20 +101,19 @@ sub execute { } # Check the requested action - $self->{action} = $parameters{action} || 'home'; + my $action = $parameters{action} || 'home'; - if (defined $self->actions->{ $self->{action} }) { + if ($self->{actions}->{$action}) { ## Execute the target subroutine named req_actionName no strict 'refs'; - my $sub = 'req_' . $self->{action}; + my $sub = 'req_' . $action; $status = &{$sub}($self); } else { - ## Inknown action + ## inknown action push @{ $self->{param_out}->{errors} }, "unknown_action"; $self->{logger}->log( level => LOG_ERROR, - message => "Unknown action '%s'", - $self->{action} + message => "Unknown action '$action'" ); } -- GitLab