@@ -, +, @@ case insensitive - Use koha-testing-docker - Notice the value of OPACBaseURL - Use the "reports a problem" feature at the OPAC - Notice that the "Problem found on page" is correctly filled with the --- Koha/Util/Navigation.pm | 2 +- t/Koha/Util/Navigation.t | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) --- a/Koha/Util/Navigation.pm +++ a/Koha/Util/Navigation.pm @@ -59,7 +59,7 @@ sub local_referer { # Try ..BaseURL first, otherwise use CGI::url if( $base ) { - if( substr($referer, 0, length($base)) eq $base && + if( $referer =~ m|^\Q$base\E|i && $referer =~ /\/cgi-bin\/koha\// ) { $rv = substr( $referer, length($base) ); --- a/t/Koha/Util/Navigation.t +++ a/t/Koha/Util/Navigation.t @@ -7,7 +7,7 @@ use t::lib::Mocks; use Koha::Util::Navigation; subtest 'Tests for local_referer' => sub { - plan tests => 10; + plan tests => 11; my ( $referer, $base ); my $cgi = Test::MockObject->new; @@ -26,6 +26,10 @@ subtest 'Tests for local_referer' => sub { $referer = 'https://koha.nl/custom/stuff'; is( Koha::Util::Navigation::local_referer($cgi), '/', 'custom url' ); + t::lib::Mocks::mock_preference('OPACBaseURL', 'http://kohadev.myDNSname.org:8080'); + $referer = "http://kohadev.mydnsname.org:8080$search"; + is( Koha::Util::Navigation::local_referer($cgi), $search, 'local_referer is comparing $OPACBaseURL case insensitive' ); + # trailing backslash t::lib::Mocks::mock_preference('OPACBaseURL', 'http://koha.nl/' ); $referer = "http://koha.nl$search"; --