Go to file
Bernard Scaife 5709be47e4
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>
(cherry picked from commit affa3e62fd)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-09-25 16:22:51 +02:00
C4 Bug 40675: Fix SIP message corruption from embedded line endings 2025-09-25 16:22:51 +02:00
Koha Bug 31460: Merge item groups when merging records 2025-09-25 16:22:45 +02:00
acqui Bug 39572: Improve EDIFACT order confirmation message 2025-07-24 10:23:14 +02:00
admin Bug 40734: Fix creating new library with additional fields 2025-09-25 16:22:41 +02:00
api Revert "Bug 36135: Add ability to batch modify holds" 2025-09-25 15:55:56 +02:00
authorities Bug 38514: Filter out autocomplete list of authorities with ConsiderHeadingUse 2025-08-22 09:47:58 +02:00
basket Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
bin
…
bookings Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
catalogue Bug 37883: Add ability to filter search results location column by logged in location 2025-09-16 14:02:11 +02:00
cataloguing Bug 37116: Redirect to serial modification when modifying an item 2025-09-20 10:42:40 +02:00
circ Bug 40708: Return the specific error to the checkin page 2025-09-25 16:22:48 +02:00
clubs Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
course_reserves Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
debian Bug 40812: Move Theke sample plugin repo to GitHub 2025-09-25 16:22:44 +02:00
docs Bug 40022: Sync teams in Koha, Wiki and release-tools 2025-07-10 22:47:12 +02:00
erm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
errors Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
etc Bug 40812: Move Theke sample plugin repo to GitHub 2025-09-25 16:22:44 +02:00
ill Bug 40075: Only show pickup_location libraries 2025-08-22 09:48:34 +02:00
installer Revert "Bug 36135: Add batch_modify_holds permissions" 2025-09-25 15:55:57 +02:00
koha-tmpl Bug 40585: (follow-up) Display error if no records were found 2025-09-25 16:22:50 +02:00
labels Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
lib Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
members Bug 40305: Fix 'tendered' vs 'collected' variable name inconsistency 2025-09-16 14:02:24 +02:00
misc Bug 35654: (follow-up) Update example script to be compatible with change to using Koha::Items 2025-09-20 10:43:04 +02:00
offline_circ Bug 40275: Use Koha::Patrons->find_by_identifier in the codebase 2025-09-20 10:43:37 +02:00
opac Bug 40585: Check on Biblios->find in addbybiblionumber scripts 2025-09-25 16:22:50 +02:00
patron_lists Bug 37266: patron_lists/delete.pl should have CSRF protection 2025-03-06 13:54:49 +01:00
patroncards Bug 39800: Error 500 when trying to delete patron card template 2025-05-19 09:49:41 +02:00
plugins Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
pos Bug 40305: Fix 'tendered' vs 'collected' variable name inconsistency 2025-09-16 14:02:24 +02:00
preservation Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
recalls Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
reports Bug 40419: Fix wrong license 2025-07-24 10:23:34 +02:00
reserve Bug 9762: Log circulation overrides 2025-09-20 10:43:21 +02:00
reviews Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
rotating_collections Bug 31930: Ignore whitespace before and after barcodes 2025-08-22 09:48:05 +02:00
serials Bug 34971: (QA follow-up) Op is now cud-reopen 2025-02-12 15:28:17 +01:00
services Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
skel
…
suggestion Bug 36155: Improve perfs of suggestion.pl when there are many budgets 2025-09-20 10:43:15 +02:00
svc Bug 9762: (follow-up) Add branchcode to Log circulation and add some override confirmations in action logs, fix typos 2025-09-20 10:43:26 +02:00
t Bug 40708: Fix Circulation/Returns.t 2025-09-25 16:22:48 +02:00
tags Bug 38969: (QA follow-up) fix tidy 2025-04-28 18:51:18 +02:00
tools Bug 40702: Add missing "Title" header in Inventory csv export 2025-09-25 16:22:40 +02:00
virtualshelves Bug 40585: (follow-up) Display error if no records were found 2025-09-25 16:22:50 +02:00
xt Bug 40315: (QA follow-up) Fix shebang for both tests 2025-09-16 14:02:27 +02:00
.codespell-ignore Bug 39325: (QA follow-up) Adjust some issues 2025-04-28 18:51:30 +02:00
.editorconfig
…
.git-blame-ignore-revs Bug 39096: Add 'tidy all' commits to a git blame ignore file 2025-02-17 13:10:25 +01:00
.gitignore Bug 40838: Add generated bookings CSS assets to gitignore 2025-09-25 16:22:51 +02:00
.htaccess
…
.mailmap 25.05.00: Update .mailmap (part 4) 2025-05-26 10:19:09 -03:00
.perlcriticrc
…
.perltidyrc
…
.prettierrc.js Bug 38664: Treat .vue files like other JS files 2025-02-11 14:58:25 +01:00
.proverc.dist
…
.stylelintrc.json
…
INSTALL
…
Koha.pm Revert "Bug 36135: DBRev 25.05.03.008" 2025-09-25 15:55:53 +02:00
LICENSE
…
MANIFEST.SKIP
…
Makefile.PL Bug 40773: Do not map "vue/dist" files in Makefile 2025-09-25 16:22:38 +02:00
README
…
README.md
…
README.robots
…
about.pl Bug 40608: (follow-up) Add warning in about page 2025-09-20 10:42:34 +02:00
app.psgi Bug 36149: Add userenv middleware to app.psgi 2024-05-14 15:04:37 -03:00
build-resources.PL
…
changelanguage.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
cpanfile Bug 40164: Add Template::Plugin::JSON dependency 2025-07-10 22:47:33 +02:00
cypress.config.ts Bug 40346: Use KOHA_INTRANET_URL for the baseUrl 2025-08-22 09:47:41 +02:00
eslint.config.mjs Bug 38524: Enable ESLint for .ts and .vue files 2025-01-16 15:56:17 +01:00
fix-perl-path.PL Bug 39325: (QA follow-up) Adjust some issues 2025-04-28 18:51:30 +02:00
gulpfile.js Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
help.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
kohaversion.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
mainpage.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
package.json Bug 40170: Replace cypress-mysql with mysql2 - Cypress tests 2025-07-10 22:47:37 +02:00
rewrite-config.PL Bug 39834: Replace some tabs with spaces 2025-06-17 21:42:59 +02:00
rspack.config.js Bug 40173: Make http-client reusable from Cypress tests 2025-08-22 09:47:30 +02:00
tsconfig.json
…
yarn.lock Bug 40170: Update yarn.lock 2025-07-10 22:47:42 +02:00

README.md

Koha is a free software integrated library system (ILS).

Koha is distributed under the GNU GPL version 3 or later.

Note: Koha does not accept pull requests from git hosting sites.

Note: This project has its own bug tracker, to report a bug or submit a patch visit http://bugs.koha-community.org.

For guidelines on submitting patches for Koha please visit https://wiki.koha-community.org/wiki/SubmitingAPatch

The developers handbook can be found at https://wiki.koha-community.org/wiki/Developer_handbook

http://koha-community.org/

Koha Logo