From 6fb1a745024d7205fdbafa9bf2ea1bab8236fda8 Mon Sep 17 00:00:00 2001 From: Bernard Scaife Date: Wed, 20 Aug 2025 10:53:38 +0000 Subject: [PATCH] Bug 40675 Removes carriage returns from messages to prevent breaking SIP Test 1. Find a user and click "Add message". 2. Choose "Add message for OPAC ... " from dropdown 3. In Word (or similar, type a message adding a carriage return in the middle of it. 4. Copy / paste this text into the message box and save. 5. Run the SIP emulator tool sip_cli_emulator.pl and observe that after the carriage return, the message has broken onto a new line. 6. Install patch 7. restart_all 8. Repeat above 1-5 9. Observe that runaway line is now joined to the previous line (correctly) --- C4/SIP/Sip.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/SIP/Sip.pm b/C4/SIP/Sip.pm index c4cff7ee94..0edef706e7 100644 --- a/C4/SIP/Sip.pm +++ b/C4/SIP/Sip.pm @@ -97,8 +97,8 @@ sub add_field { ); $value = ''; } - $value =~ s/\r/ /g; # CR terminates a sip message - # Protect against them in sip text fields + $value =~ s/\r\n/ /g; # CR terminates a sip message + # Protect against them in sip text fields # Replace any occurrences of the field delimiter in the # field value with the HTML character entity -- 2.39.5