aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/vobject/lib/Property.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-05-14 17:23:19 -0700
committerzotlabs <mike@macgirvin.com>2018-05-14 17:23:19 -0700
commit229d82c4c7ca37c304d1291be7f71ba4b0632f03 (patch)
tree9f0ce27c1e82380987dd9ea317d6bf8e516f7a6b /vendor/sabre/vobject/lib/Property.php
parentd9759ba63c8fd70c4da66669389bd19bae3333ff (diff)
parent2d1dbc8f40d0b9fa89b99861fac30d579a400e34 (diff)
downloadvolse-hubzilla-229d82c4c7ca37c304d1291be7f71ba4b0632f03.tar.gz
volse-hubzilla-229d82c4c7ca37c304d1291be7f71ba4b0632f03.tar.bz2
volse-hubzilla-229d82c4c7ca37c304d1291be7f71ba4b0632f03.zip
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge
Diffstat (limited to 'vendor/sabre/vobject/lib/Property.php')
-rw-r--r--vendor/sabre/vobject/lib/Property.php24
1 files changed, 11 insertions, 13 deletions
diff --git a/vendor/sabre/vobject/lib/Property.php b/vendor/sabre/vobject/lib/Property.php
index 96855f1f7..3d1775fa2 100644
--- a/vendor/sabre/vobject/lib/Property.php
+++ b/vendor/sabre/vobject/lib/Property.php
@@ -246,20 +246,18 @@ abstract class Property extends Node {
$str .= ':' . $this->getRawMimeDirValue();
- $out = '';
- while (strlen($str) > 0) {
- if (strlen($str) > 75) {
- $part = mb_strcut($str, 0, 75, 'utf-8');
- $out .= $part . "\r\n";
- $str = ' ' . substr($str, strlen($part));
- } else {
- $out .= $str . "\r\n";
- $str = '';
- break;
- }
- }
+ $str = \preg_replace(
+ '/(
+ (?:^.)? # 1 additional byte in first line because of missing single space (see next line)
+ .{1,74} # max 75 bytes per line (1 byte is used for a single space added after every CRLF)
+ (?![\x80-\xbf]) # prevent splitting multibyte characters
+ )/x',
+ "$1\r\n ",
+ $str
+ );
- return $out;
+ // remove single space after last CRLF
+ return \substr($str, 0, -1);
}