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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-1 / +2 lines)
Lines 1055-1061 Link Here
1055
                                    <span>Previous</span>
1055
                                    <span>Previous</span>
1056
                                [% END %]
1056
                                [% END %]
1057
                            </li>
1057
                            </li>
1058
                            <li class="back_results"><a href="opac-search.pl?[% busc |url %]" title="Back to the results search list">Back to results</a></li>
1058
                            [%# busc is already URI encoded %]
1059
                            <li class="back_results"><a href="opac-search.pl?[% busc %]" title="Back to the results search list">Back to results</a></li>
1059
                            <li class="right_results">
1060
                            <li class="right_results">
1060
                                [% IF ( nextBiblionumber ) %]
1061
                                [% IF ( nextBiblionumber ) %]
1061
                                    <a href="opac-detail.pl?biblionumber=[% nextBiblionumber %][% IF ( query_desc && OpacHighlightedWords ) %]&query_desc=[% query_desc |uri %][% END %]" title="See: [% IF ( nextTitle ) %][% nextTitle |html %][% ELSE %]next biblio[% END %]">Next &raquo;</a>
1062
                                    <a href="opac-detail.pl?biblionumber=[% nextBiblionumber %][% IF ( query_desc && OpacHighlightedWords ) %]&query_desc=[% query_desc |uri %][% END %]" title="See: [% IF ( nextTitle ) %][% nextTitle |html %][% ELSE %]next biblio[% END %]">Next &raquo;</a>
(-)a/opac/opac-detail.pl (-5 / +7 lines)
Lines 154-161 my $session = get_session($query->cookie("CGISESSID")); Link Here
154
my %paging = (previous => {}, next => {});
154
my %paging = (previous => {}, next => {});
155
if ($session->param('busc')) {
155
if ($session->param('busc')) {
156
    use C4::Search;
156
    use C4::Search;
157
    use URI::Escape;
157
158
158
    # Rebuild the string to store on session
159
    # Rebuild the string to store on session
160
    # param value is URI encoded and params separator is HTML encode (&amp;)
159
    sub rebuildBuscParam
161
    sub rebuildBuscParam
160
    {
162
    {
161
        my $arrParamsBusc = shift;
163
        my $arrParamsBusc = shift;
Lines 166-178 if ($session->param('busc')) { Link Here
166
            if ($_ =~ /^(?:query|listBiblios|newlistBiblios|query_type|simple_query|total|offset|offsetSearch|next|previous|count|expand|scan)/) {
168
            if ($_ =~ /^(?:query|listBiblios|newlistBiblios|query_type|simple_query|total|offset|offsetSearch|next|previous|count|expand|scan)/) {
167
                if (defined($arrParamsBusc->{$_})) {
169
                if (defined($arrParamsBusc->{$_})) {
168
                    $pasarParams .= '&amp;' if ($j);
170
                    $pasarParams .= '&amp;' if ($j);
169
                    $pasarParams .= $_ . '=' . $arrParamsBusc->{$_};
171
                    $pasarParams .= $_ . '=' . uri_escape( $arrParamsBusc->{$_} );
170
                    $j++;
172
                    $j++;
171
                }
173
                }
172
            } else {
174
            } else {
173
                for my $value (@{$arrParamsBusc->{$_}}) {
175
                for my $value (@{$arrParamsBusc->{$_}}) {
174
                    $pasarParams .= '&amp;' if ($j);
176
                    $pasarParams .= '&amp;' if ($j);
175
                    $pasarParams .= $_ . '=' . $value;
177
                    $pasarParams .= $_ . '=' . uri_escape($value);
176
                    $j++;
178
                    $j++;
177
                }
179
                }
178
            }
180
            }
Lines 234-245 if ($session->param('busc')) { Link Here
234
    for (@arrBusc) {
236
    for (@arrBusc) {
235
        ($key, $value) = split(/=/, $_, 2);
237
        ($key, $value) = split(/=/, $_, 2);
236
        if ($key =~ /^(?:query|listBiblios|newlistBiblios|query_type|simple_query|next|previous|total|offset|offsetSearch|count|expand|scan)/) {
238
        if ($key =~ /^(?:query|listBiblios|newlistBiblios|query_type|simple_query|next|previous|total|offset|offsetSearch|count|expand|scan)/) {
237
            $arrParamsBusc{$key} = $value;
239
            $arrParamsBusc{$key} = uri_unescape($value);
238
        } else {
240
        } else {
239
            unless (exists($arrParamsBusc{$key})) {
241
            unless (exists($arrParamsBusc{$key})) {
240
                $arrParamsBusc{$key} = [];
242
                $arrParamsBusc{$key} = [];
241
            }
243
            }
242
            push @{$arrParamsBusc{$key}}, $value;
244
            push @{$arrParamsBusc{$key}}, uri_unescape($value);
243
        }
245
        }
244
    }
246
    }
245
    my $searchAgain = 0;
247
    my $searchAgain = 0;
Lines 312-318 if ($session->param('busc')) { Link Here
312
    for (@arrBusc) {
314
    for (@arrBusc) {
313
        unless ($_ =~ /^(?:query|listBiblios|newlistBiblios|query_type|simple_query|next|previous|total|count|offsetSearch)/) {
315
        unless ($_ =~ /^(?:query|listBiblios|newlistBiblios|query_type|simple_query|next|previous|total|count|offsetSearch)/) {
314
            $buscParam .= '&amp;' unless ($j == 0);
316
            $buscParam .= '&amp;' unless ($j == 0);
315
            $buscParam .= $_;
317
            $buscParam .= $_; # string already URI encoded
316
            $j++;
318
            $j++;
317
        }
319
        }
318
    }
320
    }
(-)a/opac/opac-search.pl (-8 / +8 lines)
Lines 341-353 $tag = $params->{tag} if $params->{tag}; Link Here
341
341
342
342
343
# String with params with the search criteria for the paging in opac-detail
343
# String with params with the search criteria for the paging in opac-detail
344
# param value is URI encoded and params separator is HTML encode (&amp;)
344
my $pasarParams = '';
345
my $pasarParams = '';
345
my $j = 0;
346
my $j = 0;
346
for (keys %$params) {
347
for (keys %$params) {
347
    my @pasarParam = $cgi->param($_);
348
    my @pasarParam = $cgi->param($_);
348
    for my $paramValue(@pasarParam) {
349
    for my $paramValue(@pasarParam) {
349
        $pasarParams .= '&amp;' if ($j > 0);
350
        $pasarParams .= '&amp;' if ($j > 0);
350
        $pasarParams .= $_ . '=' . $paramValue;
351
        $pasarParams .= $_ . '=' . uri_escape($paramValue);
351
        $j++;
352
        $j++;
352
    }
353
    }
353
}
354
}
Lines 534-543 if ($tag) { Link Here
534
        ($error, $results_hashref, $facets) = C4::Search::pazGetRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,$branches,$query_type,$scan);
535
        ($error, $results_hashref, $facets) = C4::Search::pazGetRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,$branches,$query_type,$scan);
535
    };
536
    };
536
} else {
537
} else {
537
    $pasarParams .= '&amp;query=' . $query;
538
    $pasarParams .= '&amp;query=' . uri_escape($query);
538
    $pasarParams .= '&amp;count=' . $results_per_page;
539
    $pasarParams .= '&amp;count=' . uri_escape($results_per_page);
539
    $pasarParams .= '&amp;simple_query=' . $simple_query;
540
    $pasarParams .= '&amp;simple_query=' . uri_escape($simple_query);
540
    $pasarParams .= '&amp;query_type=' . $query_type if ($query_type);
541
    $pasarParams .= '&amp;query_type=' . uri_escape($query_type) if ($query_type);
541
    eval {
542
    eval {
542
        ($error, $results_hashref, $facets) = getRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,$branches,$itemtypes,$query_type,$scan,1);
543
        ($error, $results_hashref, $facets) = getRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,$branches,$itemtypes,$query_type,$scan,1);
543
    };
544
    };
Lines 689-700 for (my $i=0;$i<@servers;$i++) { Link Here
689
                my $j = 0;
690
                my $j = 0;
690
                foreach (@newresults) {
691
                foreach (@newresults) {
691
                    my $bibnum = ($_->{biblionumber})?$_->{biblionumber}:0;
692
                    my $bibnum = ($_->{biblionumber})?$_->{biblionumber}:0;
692
                    $pasarParams .= $bibnum . ',';
693
                    $pasarParams .= uri_escape($bibnum) . ',';
693
                    $j++;
694
                    $j++;
694
                    last if ($j == $results_per_page);
695
                    last if ($j == $results_per_page);
695
                }
696
                }
696
                chop $pasarParams if ($pasarParams =~ /,$/);
697
                chop $pasarParams if ($pasarParams =~ /,$/);
697
                $pasarParams .= '&amp;total=' . int($total) if ($pasarParams !~ /total=(?:[0-9]+)?/);
698
                $pasarParams .= '&amp;total=' . uri_escape( int($total) ) if ($pasarParams !~ /total=(?:[0-9]+)?/);
698
                if ($pasarParams) {
699
                if ($pasarParams) {
699
                    my $session = get_session($cgi->cookie("CGISESSID"));
700
                    my $session = get_session($cgi->cookie("CGISESSID"));
700
                    $session->param('busc' => $pasarParams);
701
                    $session->param('busc' => $pasarParams);
701
- 

Return to bug 11515