Bugzilla – Attachment 66719 Details for
Bug 18946
Change language from external web fails
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18946 - Change language from external web fails
Bug-18946---Change-language-from-external-web-fail.patch (text/plain), 1.50 KB, created by
Kyle M Hall (khall)
on 2017-09-01 12:42:16 UTC
(
hide
)
Description:
Bug 18946 - Change language from external web fails
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2017-09-01 12:42:16 UTC
Size:
1.50 KB
patch
obsolete
>From bb5dfd1622e413c55cb205cad219ba2617fe2211 Mon Sep 17 00:00:00 2001 >From: Karam Qubsi <karamqubsi@gmail.com> >Date: Wed, 19 Jul 2017 00:06:48 +0800 >Subject: [PATCH] Bug 18946 - Change language from external web fails >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >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: Kyle M Hall <kyle@bywatersolutions.com> >--- > opac/opac-changelanguage.pl | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > >diff --git a/opac/opac-changelanguage.pl b/opac/opac-changelanguage.pl >index 9c68ab4..689f4d4 100755 >--- a/opac/opac-changelanguage.pl >+++ b/opac/opac-changelanguage.pl >@@ -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"; > >-- >2.10.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18946
:
65089
|
66719
|
66720
|
66733
|
66734