Commit r2395: https://sourceforge.net/p/mrbs/code/2395/

------------------------------------------------------------------------
r2395 | cimorrison | 2012-09-05 17:46:45 +0100 (Wed, 05 Sep 2012) | 1 line
Changed paths:
   M /mrbs/trunk/web/functions_ical.inc

Removed a theoretical bug
------------------------------------------------------------------------

Index: mrbs/trunk/web/functions_ical.inc
===================================================================
--- mrbs/trunk/web/functions_ical.inc   (revision 2394)
+++ mrbs/trunk/web/functions_ical.inc   (revision 2395)
@@ -518,7 +518,20 @@
 function ical_fold($str)
 { 
   $line_split = "\r\n ";  // The RFC also allows a tab instead of a space
-  $space_octets = utf8_bytecount(' ');  // Could be two bytes if we're using 
UTF-16
+  
+  // We assume that the string is in ASCII or UTF-8 and therefore that a space
+  // character is one octet long.   If we ever switched for some reason to 
using
+  // for example UTF-16 this assumption would be invalid.
+  if (function_exists('mb_detect_encoding'))
+  {
+    $encoding = mb_detect_encoding($str);
+    if (!in_array($encoding, array('ASCII', 'UTF-8')))
+    {
+      trigger_error("MRBS: internal error - using unsupported character set", 
E_USER_WARNING);
+    }
+  }
+  $space_octets = 1;
+
   $octets_max = 75;
   
   $result = '';

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to