From 588f13e6999bbc368fc16e7b4f3d0dab067599de Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Wed, 27 May 2015 16:11:38 -0400 Subject: [PATCH] Bug 14121: Silence warnings t/db_dependent/Auth_with_cas.t TEST PLAN --------- 1) $ prove t/db_dependent/Auth_with_cas.t -- CGI security warning 2) apply patch 3) $ prove t/db_dependent/Auth_with_cas.t -- no noise. 4) koha qa test tools Signed-off-by: Nick Clemens Signed-off-by: Kyle M Hall Not able to reproduce the error on my setup, but the code is a clear improvement over the previous version. Signed-off-by: Tomas Cohen Arazi --- C4/Auth_with_cas.pm | 9 +++++---- t/db_dependent/Auth_with_cas.t | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/C4/Auth_with_cas.pm b/C4/Auth_with_cas.pm index 2cccebe157..174933321e 100644 --- a/C4/Auth_with_cas.pm +++ b/C4/Auth_with_cas.pm @@ -208,13 +208,14 @@ sub _url_with_get_params { C4::Context->preference('staffClientBaseURL'); my $uri_params_part = ''; - foreach ( $query->url_param() ) { + foreach my $param ( $query->url_param() ) { # url_param() always returns parameters that were deleted by delete() # This additional check ensure that parameter was not deleted. - if ($query->param($_)) { + my $uriPiece = $query->param($param); + if ($uriPiece) { $uri_params_part .= '&' if $uri_params_part; - $uri_params_part .= $_ . '='; - $uri_params_part .= URI::Escape::uri_escape( $query->param($_) ); + $uri_params_part .= $param . '='; + $uri_params_part .= URI::Escape::uri_escape( $uriPiece ); } } $uri_base_part .= '?' if $uri_params_part; diff --git a/t/db_dependent/Auth_with_cas.t b/t/db_dependent/Auth_with_cas.t index b67ba1e46f..adea51b11b 100755 --- a/t/db_dependent/Auth_with_cas.t +++ b/t/db_dependent/Auth_with_cas.t @@ -38,6 +38,7 @@ my $dbh = C4::Context->dbh; $dbh->{ AutoCommit } = 0; $dbh->{ RaiseError } = 1; +C4::Context->disable_syspref_cache(); C4::Context->set_preference('OPACBaseURL','http://localhost'); C4::Context->set_preference('staffClientBaseURL','localhost:8080'); -- 2.39.5