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 151-157 $(document).ready(function() { Link Here
151
            $(event.target).text( __("Testing...") ).prop('disabled', true);
151
            $(event.target).text( __("Testing...") ).prop('disabled', true);
152
            $.ajax(Object.assign({}, {...review_ajax_params, type: "GET"}, {
152
            $.ajax(Object.assign({}, {...review_ajax_params, type: "GET"}, {
153
                data: {
153
                data: {
154
                    tag: $('#test').val(),
154
                    tag: escape_str($("#test").val()),
155
                    op: 'test',
155
                    op: 'test',
156
                },
156
                },
157
                success: success_test_call // success_reject
157
                success: success_test_call // success_reject
(-)a/opac/opac-tags.pl (-3 / +4 lines)
Lines 200-206 if ($is_ajax) { Link Here
200
		my $i = 1;
200
		my $i = 1;
201
		foreach (@errors) {
201
		foreach (@errors) {
202
			my $key = (keys %$_)[0];
202
			my $key = (keys %$_)[0];
203
			$err_string .= "\n\t\t KOHA.Tags.tag_message.$key(\"" . $_->{$key} . '")';
203
            ( my $quote_escaped = $_->{$key} ) =~ s|"|\\"|g;
204
            $err_string .= sprintf qq{\n\t\t KOHA.Tags.tag_message.%s("%s")}, $key, $quote_escaped;
204
			if($i < scalar @errors){ $err_string .= ","; }
205
			if($i < scalar @errors){ $err_string .= ","; }
205
			$i++;
206
			$i++;
206
		}
207
		}
Lines 217-223 if ($is_ajax) { Link Here
217
        foreach (@{$bibResult->{errors}}) {
218
        foreach (@{$bibResult->{errors}}) {
218
            $js_bibres .= "," if ($i);
219
            $js_bibres .= "," if ($i);
219
			my $key = (keys %$_)[0];
220
			my $key = (keys %$_)[0];
220
			$js_bibres .= "\n\t\t\t KOHA.Tags.tag_message.$key(\"" . $_->{$key} . '")';
221
            ( my $quote_escaped = $_->{$key} ) =~ s|"|\\"|g;
222
            $js_bibres .= sprintf qq{\n\t\t\t KOHA.Tags.tag_message.%s("%s")}, $key, $quote_escaped;
221
            $i++;
223
            $i++;
222
        }
224
        }
223
        $js_bibres .= "\n\t\t]\n\t}";
225
        $js_bibres .= "\n\t\t]\n\t}";
Lines 377-380 response = { Link Here
377
};
379
};
378
380
379
=cut
381
=cut
380
(-)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 60-65 if (is_ajax()) { Link Here
60
    my $op = $input->param('op') || q{};
60
    my $op = $input->param('op') || q{};
61
    my $tag = $input->param('tag');
61
    my $tag = $input->param('tag');
62
    if ($op eq 'test') {
62
    if ($op eq 'test') {
63
        $tag = uri_unescape($tag);
63
        my $check = is_approved($tag);
64
        my $check = is_approved($tag);
64
        $js_reply = ( $check >=  1 ? 'success' : $check <= -1 ? 'failure' : 'indeterminate' ) . "_test('".uri_escape_utf8($tag)."');\n";
65
        $js_reply = ( $check >=  1 ? 'success' : $check <= -1 ? 'failure' : 'indeterminate' ) . "_test('".uri_escape_utf8($tag)."');\n";
65
    }
66
    }
66
- 

Return to bug 38969