From 7fceb07b87480962649b413f08d66dd9cedcf5ca Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Wed, 28 Jun 2017 14:47:58 +0200 Subject: [PATCH] Fixed issue #1200 - OTRS import fails for attributes containing null bytes strings on PostgreSQL. --- lib/import/otrs/requester.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/import/otrs/requester.rb b/lib/import/otrs/requester.rb index c3dbbf049..ef504cf71 100644 --- a/lib/import/otrs/requester.rb +++ b/lib/import/otrs/requester.rb @@ -95,6 +95,8 @@ module Import def handle_response(response) encoded_body = Encode.conv('utf8', response.body.to_s) + # remove null bytes otherwise PostgreSQL will fail + encoded_body.gsub!('\u0000', '') JSON.parse(encoded_body) end