Bug 5471: Use uri_escape_utf8 to handle utf8 chars correctly
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 10 Aug 2017 16:15:27 +0000 (13:15 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 10 Aug 2017 16:20:31 +0000 (13:20 -0300)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

tags/review.pl

index 009966d..f1484f1 100755 (executable)
@@ -63,13 +63,13 @@ if (is_ajax()) {
        my ($tag, $js_reply);
        if ($tag = $input->param('test')) {
                my $check = is_approved($tag);
-        $js_reply = ( $check >=  1 ? 'success' : $check <= -1 ? 'failure' : 'indeterminate' ) . "_test('".uri_escape($tag)."');\n";
+        $js_reply = ( $check >=  1 ? 'success' : $check <= -1 ? 'failure' : 'indeterminate' ) . "_test('".uri_escape_utf8($tag)."');\n";
        }
        if ($tag = $input->param('ok')) {
-        $js_reply = (   whitelist($operator,$tag) ? 'success' : 'failure') . "_approve('".uri_escape($tag)."');\n";
+        $js_reply = (   whitelist($operator,$tag) ? 'success' : 'failure') . "_approve('".uri_escape_utf8($tag)."');\n";
        } 
        if ($tag = $input->param('rej')) {
-        $js_reply = (   blacklist($operator,$tag) ? 'success' : 'failure')  . "_reject('".uri_escape($tag)."');\n";
+        $js_reply = (   blacklist($operator,$tag) ? 'success' : 'failure')  . "_reject('".uri_escape_utf8($tag)."');\n";
        }
        output_with_http_headers $input, undef, $js_reply, 'js';
        exit;