From 1749143ea134d8db6978126ef100fcb40eeb0e3a Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Thu, 11 Feb 2016 09:51:52 -0500 Subject: [PATCH] Bug 15747 Auth.pm flooding error log with "CGI::param called in list context" Content-Type: text/plain; charset=utf-8 TEST PLAN --------- 1) git checkout -b bug_15747 origin/master 2) echo > ~/koha-dev/var/log/koha-error_log 3) open up staff interface and log in. 4) cat ~/koha-dev/var/log/koha-error_log *** BEGIN SNIP *** [Thu Feb 11 09:49:43.627711 2016] [cgi:error] [pid 2132] [client 192.168.71.222:51107] AH01215: [Thu Feb 11 09:49:43 2016] mainpage.pl: CGI::param called in list context from package C4::Auth line 401, this can lead to vulnerabilities. See the warning in "Fetching the value or values of a single named parameter" at /usr/share/perl5/CGI.pm line 436., referer: http://library-admin.debiankoha.ca/ *** END SNIP *** 5) logout 6) apply patch 7) echo > ~/koha-dev/var/log/koha-error_log 8) log back in. 9) cat ~/koha-dev/var/log/koha-error_log -- this time should not be there. 10) koha qa test tools Signed-off-by: Marcel de Rooy Warning probably depends on the version of perl/CGI. But this clearly makes it a scalar. --- C4/Auth.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 9481f73..ac055fe 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -398,7 +398,8 @@ sub get_template_and_user { $template->param( dateformat => C4::Context->preference('dateformat') ); } - $template->param(auth_forwarded_hash => $in->{'query'}->param('auth_forwarded_hash')); + my $auth_forwarded_hash = $in->{'query'}->param('auth_forwarded_hash'); + $template->param(auth_forwarded_hash => $auth_forwarded_hash); # these template parameters are set the same regardless of $in->{'type'} -- 1.7.10.4