Bug 18946 - Change language from external web fails
How to reproduce: 1. Get a multilingüal Koha like http://demo1.orex.es/cgi-bin/koha/opac-changelanguage.pl?language=en http://demo1.orex.es/cgi-bin/koha/opac-changelanguage.pl?language=es-ES 2. Copy that urls to any web page in an other domain -it must be in some host - and try to link to the spanish or english version,it will keep you in the same position. 3. Apply this patch and try again , everything should work fine . Signed-off-by: Hugo Agud <hagud@orex.es> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
bb31d99065
commit
48f54016a7
1 changed files with 4 additions and 1 deletions
|
@ -22,7 +22,10 @@ use CGI qw ( -utf8 );
|
|||
|
||||
my $query = new CGI;
|
||||
my $language = $query->param('language');
|
||||
my $url = $query->referer() || '/';
|
||||
# Detect where the user came from and save that url
|
||||
my $requestedUrl = $query->url(-base => 1) ;
|
||||
# Use referer url if it matches $requestedUrl else use $requestedUrl as the url .
|
||||
my $url = $query->referer()=~$requestedUrl ? $query->referer() : $requestedUrl;
|
||||
|
||||
# warn "Language : $query // $language // $url";
|
||||
|
||||
|
|
Loading…
Reference in a new issue