diff --git a/lib.php b/lib.php index fd9d58d..61b5176 100644 --- a/lib.php +++ b/lib.php @@ -3148,8 +3148,9 @@ function facetoface_ical_escape($text, $converthtml=false) { ); // Text should be wordwrapped at 75 octets, and there should be one whitespace after the newline that does the wrapping. - $text = wordwrap($text, 75, " \n ", true); - + // Use chunk_split so that words are wrapped exactly at 75 characters as opposed to wordwrap function + // that wraps at word bounaries. + $text = rtrim(chunk_split($text, 75, "\n "), "\n "); return $text; }