From 4d76356a9b703a05c31483b4c97869bc2633fff5 Mon Sep 17 00:00:00 2001 From: djarrancotleanu Date: Mon, 16 Dec 2024 15:34:34 +1000 Subject: [PATCH] bugfix: use chunk_split --- lib.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; }