[Koha-patches] [PATCH] Bug 2653 Protect against sending End of Message in Text

Colin Campbell colin.campbell at ptfs-europe.com
Tue Feb 23 12:12:32 CET 2010


Remove any carriage returns in text data as they will be
interpreted as end of message by clients and cause communication failure
---
 C4/SIP/Sip.pm |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/C4/SIP/Sip.pm b/C4/SIP/Sip.pm
index 558a1d4..f176516 100644
--- a/C4/SIP/Sip.pm
+++ b/C4/SIP/Sip.pm
@@ -65,6 +65,8 @@ sub add_field {
 	       $field_id);
 		$value = '';
     }
+    $value=~s/\r/ /g; # CR terminates a sip message
+                      # Protect against them in sip text fields
 
     # Replace any occurences of the field delimiter in the
     # field value with the HTML character entity
-- 
1.6.6.1




More information about the Koha-patches mailing list