diff --git a/CHANGELOG.md b/CHANGELOG.md index c0f000db2..84965287c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). It uses [CalVer](https://calver.org/) as of May 2019. +## [22.05b](https://github.com/berkmancenter/lumendatabase/releases/tag/2022.05b) - 2022-05-13 +### Fixed +* Started stripping `\u0000` unicode characters when submitting new notices. PostgreSQL doesn't like it. + ## [22.05a](https://github.com/berkmancenter/lumendatabase/releases/tag/2022.05a) - 2022-05-13 ### Changed * Stopped using the `infringing_urls`, `copyrighted_url` and `works` database tables. Moved to `jsonb` fields in the `notices` table. diff --git a/app/models/notice.rb b/app/models/notice.rb index 1551694c4..0013bc093 100644 --- a/app/models/notice.rb +++ b/app/models/notice.rb @@ -406,7 +406,8 @@ def prep_work_json(work) json[:description_original] = work.description_original end - json + # FIXME Find a way to do this in the middleware to avoid Hash <> JSON conversion + JSON.parse(json.to_json.gsub(/\\u0000/, '')) end def prep_url_json(url_instance)