aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/vobject/lib/Property.php
diff options
context:
space:
mode:
authorKlaus Weidenbach <Klaus.Weidenbach@gmx.net>2018-05-04 22:44:22 +0200
committerKlaus Weidenbach <Klaus.Weidenbach@gmx.net>2018-05-09 21:07:25 +0200
commitdafe0afa65171f55146f49f3d45fb4c126073be9 (patch)
treeecdff36542dad91aa54023b6d6fb928ce5168718 /vendor/sabre/vobject/lib/Property.php
parent30d0f9888c049f487769f34d2cce51560bc5925e (diff)
downloadvolse-hubzilla-dafe0afa65171f55146f49f3d45fb4c126073be9.tar.gz
volse-hubzilla-dafe0afa65171f55146f49f3d45fb4c126073be9.tar.bz2
volse-hubzilla-dafe0afa65171f55146f49f3d45fb4c126073be9.zip
:arrow_up: Update libraries.
Updating smarty/smarty (v3.1.31 => v3.1.32) Updating sabre/vobject (4.1.5 => 4.1.6)
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);
}