Bug 14121: Silence warnings t/db_dependent/Auth_with_cas.t
authorMark Tompsett <mtompset@hotmail.com>
Wed, 27 May 2015 20:11:38 +0000 (16:11 -0400)
committerTomas Cohen Arazi <tomascohen@unc.edu.ar>
Mon, 20 Jul 2015 13:32:21 +0000 (10:32 -0300)
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 <nick@quecheelibrary.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
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 <tomascohen@unc.edu.ar>
C4/Auth_with_cas.pm
t/db_dependent/Auth_with_cas.t

index 2cccebe..1749333 100644 (file)
@@ -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;
index b67ba1e..adea51b 100755 (executable)
@@ -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');