Koha-clms/C4
Bernard Scaife affa3e62fd
Bug 40675: Fix SIP message corruption from embedded line endings
Patron messages containing carriage returns, line feeds, or CRLF
combinations can break SIP protocol communication since CR is used
as the SIP message terminator. This causes message parsing failures
and protocol errors in self-check systems.

The previous regex only handled single carriage returns (\r),
missing Windows CRLF (\r\n) and Unix LF (\n) sequences.

This patch normalizes all line ending variations to spaces to
prevent SIP message corruption while preserving message content.

Test plan:
1. Go to a patron record and click "Add message"
2. Select "Add message for OPAC..." from dropdown
3. In a text editor (e.g., Word), create a message with line breaks:
   "This is line one[Enter]This is line two[Enter]This is line three"
4. Copy and paste this multi-line text into the message box and save
5. Run the SIP emulator: misc/sip_cli_emulator.pl
6. Execute a patron information request for this patron
7. Before patch: Observe message breaks at line endings, corrupting
   the SIP response
8. Apply patch and restart SIP server
9. Repeat steps 5-6
10. After patch: Verify the message appears as single line with
    spaces replacing line breaks: "This is line one This is line two
    This is line three"
11. Test with different line ending types (Windows, Mac, Unix) to
    ensure all variations are handled correctly

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Adjusted the comment in Sip.pm
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-19 08:42:47 -06:00
..
AuthoritiesMarc Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Barcodes Bug 39367: Manual changes 2025-04-23 09:35:15 +02:00
ClassSortRoutine Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
ClassSplitRoutine Bug 40388: Remove warning from t/Labels.t 2025-07-18 11:09:51 -06:00
Creators Bug 39325: Automatic fix 2025-04-28 18:51:22 +02:00
External Bug 39834: Replace some tabs with spaces 2025-06-02 15:26:17 -06:00
Form Bug 34776: Add unit tests for sub restore_form_values 2025-06-30 08:30:51 -06:00
Heading Bug 39415: (follow-up) Add 651g to bib heading fields as well 2025-05-06 18:48:18 +02:00
ILSDI Bug 39325: Automatic fix 2025-04-28 18:51:22 +02:00
Installer Bug 39367: Manual changes 2025-04-23 09:35:15 +02:00
Labels Bug 34157: Exporting labels as a barcode range can cause 500 error 2025-07-15 16:32:52 -06:00
Linker Bug 39367: Manual changes 2025-04-23 09:35:15 +02:00
Members Bug 39325: Automatic fix 2025-04-28 18:51:22 +02:00
OAI Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Output Bug 39367: Automatic changes 2025-04-23 09:35:14 +02:00
Patroncards Bug 39367: Manual changes 2025-04-23 09:35:15 +02:00
Reports Bug 39325: Manual fixes 2025-04-28 18:51:23 +02:00
SIP Bug 40675: Fix SIP message corruption from embedded line endings 2025-09-19 08:42:47 -06:00
Search Bug 39367: Manual changes 2025-04-23 09:35:15 +02:00
Serials Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Utils/DataTables Bug 39427: Searching lists table by owner can only enter firstname or surname 2025-08-01 13:22:38 -06:00
Accounts.pm Bug 39325: Automatic fix 2025-04-28 18:51:22 +02:00
Acquisition.pm Bug 39325: Automatic fix 2025-04-28 18:51:22 +02:00
Auth.pm Bug 40275: Use Koha::Patrons->find_by_identifier in the codebase 2025-09-03 14:00:46 -06:00
Auth_cas_servers.yaml.sample
…
Auth_with_cas.pm Bug 40275: Use Koha::Patrons->find_by_identifier in the codebase 2025-09-03 14:00:46 -06:00
Auth_with_ldap.pm Bug 39834: Replace some tabs with spaces 2025-06-02 15:26:17 -06:00
Auth_with_shibboleth.pm Bug 39367: Manual changes 2025-04-23 09:35:15 +02:00
AuthoritiesMarc.pm Bug 40119: (QA follow-up) Small additional comment 2025-06-13 13:21:37 -06:00
Barcodes.pm Bug 39834: Replace some tabs with spaces 2025-06-02 15:26:17 -06:00
Biblio.pm Bug 38619: UNIMARC prices should also be extracted from 071d 2025-08-14 16:05:46 -06:00
Breeding.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Budgets.pm Bug 39834: Replace some tabs with spaces 2025-06-02 15:26:17 -06:00
Calendar.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Charset.pm Bug 39834: Replace some tabs with spaces 2025-06-02 15:26:17 -06:00
Circulation.pm Bug 40708: Return the specific error to the checkin page 2025-09-19 08:42:43 -06:00
ClassSortRoutine.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
ClassSource.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
ClassSplitRoutine.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Context.pm Bug 39325: Automatic fix 2025-04-28 18:51:22 +02:00
Contract.pm Bug 39325: Automatic fix 2025-04-28 18:51:22 +02:00
CourseReserves.pm Bug 39367: Automatic changes 2025-04-23 09:35:14 +02:00
Creators.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
HTML5Media.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Heading.pm Bug 38729: Linker should consider diacritics 2025-04-14 08:50:57 +02:00
HoldsQueue.pm Bug 40620: Holds Queue will assign to the lowest item number if multiple branches have the same transport cost 2025-08-22 07:45:01 -06:00
ImportBatch.pm Bug 39367: Automatic changes 2025-04-23 09:35:14 +02:00
ImportExportFramework.pm Bug 39325: Automatic fix 2025-04-28 18:51:22 +02:00
InstallAuth.pm Bug 39325: Automatic fix 2025-04-28 18:51:22 +02:00
Installer.pm Bug 39325: Automatic fix 2025-04-28 18:51:22 +02:00
ItemCirculationAlertPreference.pm Bug 39367: Automatic changes 2025-04-23 09:35:14 +02:00
Items.pm Bug 23010: Handle error in C4/Items.pm using try/catch 2025-06-24 16:10:21 -06:00
Koha.pm Bug 40277: Remove warn in C4::Koha::GetAuthorisedValues() 2025-07-07 10:20:27 -06:00
Labels.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
Languages.pm Bug 39325: Tidy 2025-04-28 18:51:27 +02:00
Letters.pm Bug 38997: Remove outdated developer doc 2025-08-14 16:05:47 -06:00
Linker.pm Bug 39367: Automatic changes 2025-04-23 09:35:14 +02:00
Log.pm Bug 39325: Automatic fix 2025-04-28 18:51:22 +02:00
MarcModificationTemplates.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Matcher.pm Bug 39325: Automatic fix 2025-04-28 18:51:22 +02:00
Members.pm Bug 37418: delete_patrons.pl: Exclude patrons with restrictions 2025-04-25 08:46:53 +02:00
Message.pm Bug 39367: Automatic changes 2025-04-23 09:35:14 +02:00
Output.pm Bug 39367: Manual changes 2025-04-23 09:35:15 +02:00
Overdues.pm Bug 39405: (follow-up) Add the parameter borrowernumber to the overwrite_calc_fine plugin hook 2025-04-25 08:46:49 +02:00
Patroncards.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Record.pm Bug 39834: Replace some tabs with spaces 2025-06-02 15:26:17 -06:00
Reports.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Reserves.pm Bug 40636: (follow-up) Cache the calendar object 2025-09-05 08:02:32 -06:00
Ris.pm Bug 39367: Automatic changes 2025-04-23 09:35:14 +02:00
RotatingCollections.pm Bug 39325: Automatic fix 2025-04-28 18:51:22 +02:00
SMS.pm Bug 39325: Automatic fix 2025-04-28 18:51:22 +02:00
Scheduler.pm Bug 39325: Automatic fix 2025-04-28 18:51:22 +02:00
Scrubber.pm Bug 40079: (follow-up) Improve test coverage and fix undef handling 2025-06-30 08:30:44 -06:00
Search.pm Bug 37883: (follow-up) Increment counts correctly 2025-07-23 16:36:45 -06:00
Serials.pm Bug 39834: Replace some tabs with spaces 2025-06-02 15:26:17 -06:00
Service.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
ShelfBrowser.pm Bug 39834: Replace some tabs with spaces 2025-06-02 15:26:17 -06:00
SocialData.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Stats.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Suggestions.pm Bug 39325: Automatic fix 2025-04-28 18:51:22 +02:00
TTParser.pm Bug 39325: Automatic fix 2025-04-28 18:51:22 +02:00
Tags.pm Bug 39834: Replace some tabs with spaces 2025-06-02 15:26:17 -06:00
Templates.pm Bug 39367: Automatic changes 2025-04-23 09:35:14 +02:00
TmplToken.pm Bug 39367: Automatic changes 2025-04-23 09:35:14 +02:00
TmplTokenType.pm Bug 39367: Automatic changes 2025-04-23 09:35:14 +02:00
UsageStats.pm Bug 39325: Automatic fix 2025-04-28 18:51:22 +02:00
XISBN.pm Bug 39367: Automatic changes 2025-04-23 09:35:14 +02:00
XSLT.pm Bug 39367: Automatic changes 2025-04-23 09:35:14 +02:00