[Koha-bugs] [Bug 19655] To.json doesn't escape newlines which can create invalid JSON

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Nov 24 07:59:39 CET 2017


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19655

Marcel de Rooy <m.de.rooy at rijksmuseum.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #69244|0                           |1
        is obsolete|                            |

--- Comment #3 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
Created attachment 69326
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69326&action=edit
Bug 19655 - To.json doesn't escape newlines which can create invalid JSON

JSON does not allow real line-breaks. If a field contains them and they are not
escaped, a JSON parser will be unable to convert the stringified JSON back into
an object.

This is clearly exemplified by the guarantor search, where a multi-line note on
the guarantor's record will break the ability to select that guarantor.

Test Plan:
1) Create Patron A with a "Circulation note" that has multiple lines in it
2) Create Patron B
3) Attempt to set Patron A to be the guarantor for Patron B
4) Note selecting the patron does nothing
5) Apply this patch
6) Repeat step 3
7) Selecting the guarantor now works!

Signed-off-by: Simon Pouchol <simon.pouchol at biblibre.com>

Signed-off-by: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list