]> git.koha-community.org Git - koha.git/commit
Bug 25774: Handle utf8 chars in REST API queries
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 17 Jun 2020 07:43:40 +0000 (09:43 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 23 Jun 2020 08:31:36 +0000 (10:31 +0200)
commit1cb8d2a59dffca1ee6a8d539f8fa2d8d526c795e
treec1ae8721d7273d008aa5e40318e457143abb85fb
parent2c1bc17f6c07654c4dc5e8a40ae801c19fe79bcb
Bug 25774: Handle utf8 chars in REST API queries

We must utf8 encode the string before json decoding it.

Test plan:
Use "❤" and play with the library search (bug 25288) and Postman to
generate queries using it.

This patch prevents 500:
[2020/06/16 14:11:37] [ERROR] GET /api/v1/libraries: unhandled exception (Mojo::Exception)<<Wide character in subroutine entry at /kohadevbox/koha/Koha/REST/Plugin/Objects.pm line 107.>> Koha::REST::Plugin::Exceptions::__ANON__ /kohadevbox/koha/Koha/REST/Plugin/Exceptions.pm (73)

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b1af5a62cb74aa7dd000ae41c4be07dd6d3aa330)
Koha/REST/Plugin/Objects.pm
t/db_dependent/Koha/REST/Plugin/Objects.t