From e54152a90b0770c240232bc27363f77fed910a8d Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 1 Feb 2017 17:01:00 +0100 Subject: [PATCH] Bug 14224: Improve escaped characters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To recreate the problem, submit a note like doh"doh Signed-off-by: Jonathan Druart Signed-off-by: Josef Moravec Signed-off-by: Marc VĂ©ron Signed-off-by: Kyle M Hall --- opac/svc/patron_notes | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/opac/svc/patron_notes b/opac/svc/patron_notes index 1ae53aefe6..e26c266f7c 100755 --- a/opac/svc/patron_notes +++ b/opac/svc/patron_notes @@ -19,6 +19,7 @@ use Modern::Perl; +use JSON qw( to_json ); use C4::Service; use C4::Auth qw /check_cookie_auth/; use C4::Letters; @@ -96,8 +97,8 @@ if ($is_ajax) { $status = "fail"; } - my $response = "{\"status\": \"$status\", \"note\": \"$clean_note\", \"issue_id\": \"$issue_id\"}"; - output_with_http_headers($query, undef, $response, 'js'); + my $json = to_json ( { status => $status, note => $clean_note, issue_id => $issue_id } ); + output_with_http_headers($query, undef, $json, 'json'); exit; } # END Issue Note }