Bug 4461: Use our local_referer instead of HTTP_REFERER
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 26 Feb 2020 10:28:30 +0000 (11:28 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 6 Apr 2020 10:17:08 +0000 (11:17 +0100)
Cannot remember why exactly, but it seems that we should not use
HTTP_REFERER directly.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

opac/opac-reportproblem.pl

index a6795c1..9934ccc 100644 (file)
@@ -27,6 +27,7 @@ use Koha::ProblemReport;
 use Koha::DateUtils;
 use Koha::Libraries;
 use Koha::Patrons;
+use Koha::Util::Navigation;
 
 my $input = new CGI;
 
@@ -43,7 +44,8 @@ if ( !C4::Context->preference('OPACReportProblem') ){
     print $input->redirect("/cgi-bin/koha/errors/404.pl");
 }
 
-my $problempage = $ENV{HTTP_REFERER};
+my $problempage = C4::Context->preference('OPACBaseURL') . Koha::Util::Navigation::local_referer($input );
+
 my $member = Koha::Patrons->find($borrowernumber);
 my $username = $member->userid;
 my $branchcode = $member->branchcode;