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

(-)a/koha-tmpl/intranet-tmpl/prog/js/pages/tags-review.js (-1 / +1 lines)
Lines 148-154 $(document).ready(function() { Link Here
148
            $(event.target).text( __("Testing...") ).prop('disabled', true);
148
            $(event.target).text( __("Testing...") ).prop('disabled', true);
149
            $.ajax(Object.assign({}, review_ajax_params, {
149
            $.ajax(Object.assign({}, review_ajax_params, {
150
                data: {
150
                data: {
151
                    test: $('#test').val()
151
                    test: escape_str($("#test").val())
152
                },
152
                },
153
                success: success_test_call // success_reject
153
                success: success_test_call // success_reject
154
            }));
154
            }));
(-)a/opac/opac-tags.pl (-3 / +4 lines)
Lines 196-202 if ($is_ajax) { Link Here
196
		my $i = 1;
196
		my $i = 1;
197
		foreach (@errors) {
197
		foreach (@errors) {
198
			my $key = (keys %$_)[0];
198
			my $key = (keys %$_)[0];
199
			$err_string .= "\n\t\t KOHA.Tags.tag_message.$key(\"" . $_->{$key} . '")';
199
            ( my $quote_escaped = $_->{$key} ) =~ s|"|\\"|g;
200
            $err_string .= sprintf qq{\n\t\t KOHA.Tags.tag_message.%s("%s")}, $key, $quote_escaped;
200
			if($i < scalar @errors){ $err_string .= ","; }
201
			if($i < scalar @errors){ $err_string .= ","; }
201
			$i++;
202
			$i++;
202
		}
203
		}
Lines 213-219 if ($is_ajax) { Link Here
213
        foreach (@{$bibResult->{errors}}) {
214
        foreach (@{$bibResult->{errors}}) {
214
            $js_bibres .= "," if ($i);
215
            $js_bibres .= "," if ($i);
215
			my $key = (keys %$_)[0];
216
			my $key = (keys %$_)[0];
216
			$js_bibres .= "\n\t\t\t KOHA.Tags.tag_message.$key(\"" . $_->{$key} . '")';
217
            ( my $quote_escaped = $_->{$key} ) =~ s|"|\\"|g;
218
            $js_bibres .= sprintf qq{\n\t\t\t KOHA.Tags.tag_message.%s("%s")}, $key, $quote_escaped;
217
            $i++;
219
            $i++;
218
        }
220
        }
219
        $js_bibres .= "\n\t\t]\n\t}";
221
        $js_bibres .= "\n\t\t]\n\t}";
Lines 374-377 response = { Link Here
374
};
376
};
375
377
376
=cut
378
=cut
377
(-)a/tags/review.pl (-2 / +2 lines)
Lines 23-29 use Modern::Perl; Link Here
23
use POSIX qw( ceil );
23
use POSIX qw( ceil );
24
use CGI qw ( -utf8 );
24
use CGI qw ( -utf8 );
25
use CGI::Cookie;     # need to check cookies before having CGI parse the POST request
25
use CGI::Cookie;     # need to check cookies before having CGI parse the POST request
26
use URI::Escape qw( uri_escape_utf8 );
26
use URI::Escape qw( uri_escape_utf8 uri_unescape );
27
use C4::Auth qw( check_cookie_auth get_template_and_user );
27
use C4::Auth qw( check_cookie_auth get_template_and_user );
28
use C4::Context;
28
use C4::Context;
29
use C4::Output qw( output_with_http_headers is_ajax pagination_bar output_html_with_http_headers );
29
use C4::Output qw( output_with_http_headers is_ajax pagination_bar output_html_with_http_headers );
Lines 58-63 if (is_ajax()) { Link Here
58
    my $operator = C4::Context->userenv->{'number'};  # must occur AFTER auth
58
    my $operator = C4::Context->userenv->{'number'};  # must occur AFTER auth
59
    my ($tag, $js_reply);
59
    my ($tag, $js_reply);
60
    if ($tag = $input->param('test')) {
60
    if ($tag = $input->param('test')) {
61
        $tag = uri_unescape($tag);
61
        my $check = is_approved($tag);
62
        my $check = is_approved($tag);
62
        $js_reply = ( $check >=  1 ? 'success' : $check <= -1 ? 'failure' : 'indeterminate' ) . "_test('".uri_escape_utf8($tag)."');\n";
63
        $js_reply = ( $check >=  1 ? 'success' : $check <= -1 ? 'failure' : 'indeterminate' ) . "_test('".uri_escape_utf8($tag)."');\n";
63
    }
64
    }
64
- 

Return to bug 38969