Bug 41709

Summary: GIR segment data should be encoded in EDI ORDERs
Product: Koha Reporter: Martin Renvoize (ashimema) <martin.renvoize>
Component: AcquisitionsAssignee: Martin Renvoize (ashimema) <martin.renvoize>
Status: Signed Off --- QA Contact: Kyle M Hall (khall) <kyle>
Severity: enhancement    
Priority: P5 - low    
Version: unspecified   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: Sponsored Comma delimited list of Sponsors: OpenFifth <https://openfifth.co.uk/>
Crowdfunding goal: 0 Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 41709: Fix EDIfact special character escaping in GIR segments and other fields
Bug 41709: Fix EDIfact special character escaping in GIR segments and other fields

Description Martin Renvoize (ashimema) 2026-01-26 09:47:25 UTC
We're properly escaping special characters from bib/item records in EDI Order messages, but we don't apply that escaping to any of the GIR contents which may well also include special characters.
Comment 1 Martin Renvoize (ashimema) 2026-01-26 10:22:56 UTC
Created attachment 192014 [details] [review]
Bug 41709: Fix EDIfact special character escaping in GIR segments and other fields

Apply encode_text function to all text fields in EDIfact Order messages
to properly escape special characters (?, ', :, +) that could break
message parsing. Previously only bibliographic description fields were
escaped, but GIR segments containing collection codes, branch codes,
item types, call numbers, and other data were vulnerable.

Test plan:
- Verify all existing tests pass
- Added comprehensive tests for special character escaping in GIR segments
- Confirmed that fields containing ?, ', :, + are properly escaped
Comment 2 Martin Renvoize (ashimema) 2026-01-26 10:23:29 UTC
Created attachment 192015 [details] [review]
Bug 41709: Fix EDIfact special character escaping in GIR segments and other fields

Apply encode_text function to all text fields in EDIfact Order messages
to properly escape special characters (?, ', :, +) that could break
message parsing. Previously only bibliographic description fields were
escaped, but GIR segments containing collection codes, branch codes,
item types, call numbers, and other data were vulnerable.

Test plan:
- Verify all existing tests pass
- Added comprehensive tests for special character escaping in GIR segments
- Confirmed that fields containing ?, ', :, + are properly escaped

Sponsored-by: OpenFifth <https://openfifth.co.uk/>