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

(-)a/C4/Auth_with_shibboleth.pm (-2 / +2 lines)
Lines 201-212 sub _get_return { Link Here
201
        if ($uriPiece) {
201
        if ($uriPiece) {
202
            $uri_params_part .= '&' if $uri_params_part;
202
            $uri_params_part .= '&' if $uri_params_part;
203
            $uri_params_part .= $param . '=';
203
            $uri_params_part .= $param . '=';
204
            $uri_params_part .= URI::Escape::uri_escape( $uriPiece );
204
            $uri_params_part .= $uriPiece;
205
        }
205
        }
206
    }
206
    }
207
    $uri_base_part .= '%3F' if $uri_params_part;
207
    $uri_base_part .= '%3F' if $uri_params_part;
208
208
209
    return $uri_base_part . $uri_params_part;
209
    return $uri_base_part . URI::Escape::uri_escape_utf8($uri_params_part);
210
}
210
}
211
211
212
sub _get_shib_config {
212
sub _get_shib_config {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt (-1 / +1 lines)
Lines 55-61 Link Here
55
[% IF (invalidShibLogin ) %]
55
[% IF (invalidShibLogin ) %]
56
<div id="login_error"><Strong>Error: </strong>Shibboleth login failed</div>
56
<div id="login_error"><Strong>Error: </strong>Shibboleth login failed</div>
57
[% END %]
57
[% END %]
58
<p>If you have a shibboleth account, please <a href="[% shibbolethLoginUrl | url %]">click here</a> to login.</p>
58
<p>If you have a shibboleth account, please <a href="[% shibbolethLoginUrl | $raw %]">click here</a> to login.</p>
59
[% END %]
59
[% END %]
60
60
61
<!-- login prompt time-->
61
<!-- login prompt time-->
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc (-1 / +1 lines)
Lines 344-350 Link Here
344
                        </div>
344
                        </div>
345
                    [% ELSE %]
345
                    [% ELSE %]
346
                        <h4>Shibboleth login</h4>
346
                        <h4>Shibboleth login</h4>
347
                        <p>If you have a Shibboleth account, please <a href="[% shibbolethLoginUrl | url %]">click here to login</a>.</p>
347
                        <p>If you have a Shibboleth account, please <a href="[% shibbolethLoginUrl | $raw %]">click here to login</a>.</p>
348
                        <h4>Local Login</h4>
348
                        <h4>Local Login</h4>
349
                    [% END %]
349
                    [% END %]
350
                [% END %]
350
                [% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt (-1 / +1 lines)
Lines 83-89 Link Here
83
                                    </div>
83
                                    </div>
84
                            [% ELSE %]
84
                            [% ELSE %]
85
                                <h4>Shibboleth Login</h4>
85
                                <h4>Shibboleth Login</h4>
86
                                <p><a href="[% shibbolethLoginUrl | url %]">If you have a Shibboleth account, please click here to log in.</a></p>
86
                                <p><a href="[% shibbolethLoginUrl | $raw %]">If you have a Shibboleth account, please click here to log in.</a></p>
87
                            [% END %]
87
                            [% END %]
88
                            [% IF ( casAuthentication ) %]
88
                            [% IF ( casAuthentication ) %]
89
                                <h4>CAS login</h4>
89
                                <h4>CAS login</h4>
(-)a/t/Auth_with_shibboleth.t (-5 / +7 lines)
Lines 24-30 use Test::MockModule; Link Here
24
use Test::Warn;
24
use Test::Warn;
25
use File::Temp qw(tempdir);
25
use File::Temp qw(tempdir);
26
26
27
use CGI;
27
use utf8;
28
use CGI qw(-utf8 );
28
use C4::Context;
29
use C4::Context;
29
30
30
BEGIN {
31
BEGIN {
Lines 128-134 subtest "shib_ok tests" => sub { Link Here
128
subtest "login_shib_url tests" => sub {
129
subtest "login_shib_url tests" => sub {
129
    plan tests => 2;
130
    plan tests => 2;
130
131
131
    my $query_string = 'language=en-GB';
132
    my $string = 'language=en-GB&param="heh❤"';
133
    my $query_string = Encode::encode('UTF-8', $string);
134
    my $query_string_uri_escaped = URI::Escape::uri_escape_utf8('?'.$string);
132
135
133
    local $ENV{REQUEST_METHOD} = 'GET';
136
    local $ENV{REQUEST_METHOD} = 'GET';
134
    local $ENV{QUERY_STRING}   = $query_string;
137
    local $ENV{QUERY_STRING}   = $query_string;
Lines 138-145 subtest "login_shib_url tests" => sub { Link Here
138
        login_shib_url($query),
141
        login_shib_url($query),
139
        'https://testopac.com'
142
        'https://testopac.com'
140
          . '/Shibboleth.sso/Login?target='
143
          . '/Shibboleth.sso/Login?target='
141
          . 'https://testopac.com/cgi-bin/koha/opac-user.pl' . '%3F'
144
          . 'https://testopac.com/cgi-bin/koha/opac-user.pl'
142
          . $query_string,
145
          . $query_string_uri_escaped,
143
        "login shib url"
146
        "login shib url"
144
    );
147
    );
145
148
146
- 

Return to bug 23042