View | Details | Raw Unified | Return to bug 16776
Collapse All | Expand All

(-)a/opac/opac-changelanguage.pl (-1 / +21 lines)
Lines 25-28 my $language = $query->param('language'); Link Here
25
my $url      = $query->referer() || '/';
25
my $url      = $query->referer() || '/';
26
26
27
# warn "Language : $query // $language // $url";
27
# warn "Language : $query // $language // $url";
28
29
# If language was set by an external URL the parameter
30
# 'language=' should be removed from url string, otherwise
31
# the language picker will not work - Bug 16776
32
33
my @urlarr = split(/\?/,$url);
34
if (scalar @urlarr > 1) {
35
    my @paramarr = split(/&/,$urlarr[1]);
36
    for my $index ( reverse 0..$#paramarr ) {
37
        if ( $paramarr[$index] =~ /^language=/) {
38
            splice(@paramarr, $index, 1, ());
39
        }
40
    }
41
    if ( scalar @paramarr > 0) {
42
        $url = $urlarr[0].'?'.join('&', @paramarr);
43
    }
44
    else {
45
        $url = $urlarr[0];
46
    }
47
}
48
28
C4::Templates::setlanguagecookie( $query, $language, $url );
49
C4::Templates::setlanguagecookie( $query, $language, $url );
29
- 

Return to bug 16776