aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/vobject/lib
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/sabre/vobject/lib')
-rw-r--r--vendor/sabre/vobject/lib/ITip/Broker.php9
-rw-r--r--vendor/sabre/vobject/lib/Parser/MimeDir.php17
-rw-r--r--vendor/sabre/vobject/lib/Property.php24
-rw-r--r--vendor/sabre/vobject/lib/Property/Text.php45
-rw-r--r--vendor/sabre/vobject/lib/Version.php2
5 files changed, 49 insertions, 48 deletions
diff --git a/vendor/sabre/vobject/lib/ITip/Broker.php b/vendor/sabre/vobject/lib/ITip/Broker.php
index b9a30611b..b954cdc8d 100644
--- a/vendor/sabre/vobject/lib/ITip/Broker.php
+++ b/vendor/sabre/vobject/lib/ITip/Broker.php
@@ -897,6 +897,9 @@ class Broker {
if ($key === 'INTERVAL' && $val == 1) {
continue;
}
+ if (is_array($val)) {
+ $val = implode(',', $val);
+ }
$rrule[] = "$key=$val";
}
}
@@ -936,9 +939,9 @@ class Broker {
if (isset($attendees[$attendee->getNormalizedValue()])) {
$attendees[$attendee->getNormalizedValue()]['instances'][$recurId] = [
- 'id' => $recurId,
- 'partstat' => $partStat,
- 'force-send' => $forceSend,
+ 'id' => $recurId,
+ 'partstat' => $partStat,
+ 'forceSend' => $forceSend,
];
} else {
$attendees[$attendee->getNormalizedValue()] = [
diff --git a/vendor/sabre/vobject/lib/Parser/MimeDir.php b/vendor/sabre/vobject/lib/Parser/MimeDir.php
index 78e5bf385..742641236 100644
--- a/vendor/sabre/vobject/lib/Parser/MimeDir.php
+++ b/vendor/sabre/vobject/lib/Parser/MimeDir.php
@@ -283,22 +283,22 @@ class MimeDir extends Parser {
*/
protected function readLine() {
- if (!is_null($this->lineBuffer)) {
+ if (!\is_null($this->lineBuffer)) {
$rawLine = $this->lineBuffer;
$this->lineBuffer = null;
} else {
do {
- $eof = feof($this->input);
+ $eof = \feof($this->input);
- $rawLine = fgets($this->input);
+ $rawLine = \fgets($this->input);
- if ($eof || (feof($this->input) && $rawLine === false)) {
+ if ($eof || (\feof($this->input) && $rawLine === false)) {
throw new EofException('End of document reached prematurely');
}
if ($rawLine === false) {
throw new ParseException('Error reading from input stream');
}
- $rawLine = rtrim($rawLine, "\r\n");
+ $rawLine = \rtrim($rawLine, "\r\n");
} while ($rawLine === ''); // Skipping empty lines
$this->lineIndex++;
}
@@ -309,14 +309,15 @@ class MimeDir extends Parser {
// Looking ahead for folded lines.
while (true) {
- $nextLine = rtrim(fgets($this->input), "\r\n");
+ $nextLine = \rtrim(\fgets($this->input), "\r\n");
$this->lineIndex++;
if (!$nextLine) {
break;
}
if ($nextLine[0] === "\t" || $nextLine[0] === " ") {
- $line .= substr($nextLine, 1);
- $rawLine .= "\n " . substr($nextLine, 1);
+ $curLine = \substr($nextLine, 1);
+ $line .= $curLine;
+ $rawLine .= "\n " . $curLine;
} else {
$this->lineBuffer = $nextLine;
break;
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);
}
diff --git a/vendor/sabre/vobject/lib/Property/Text.php b/vendor/sabre/vobject/lib/Property/Text.php
index bb7ab34ee..47a86ccc9 100644
--- a/vendor/sabre/vobject/lib/Property/Text.php
+++ b/vendor/sabre/vobject/lib/Property/Text.php
@@ -213,16 +213,16 @@ class Text extends Property {
$val = $this->getParts();
if (isset($this->minimumPropertyValues[$this->name])) {
- $val = array_pad($val, $this->minimumPropertyValues[$this->name], '');
+ $val = \array_pad($val, $this->minimumPropertyValues[$this->name], '');
}
// Imploding multiple parts into a single value, and splitting the
// values with ;.
- if (count($val) > 1) {
+ if (\count($val) > 1) {
foreach ($val as $k => $v) {
- $val[$k] = str_replace(';', '\;', $v);
+ $val[$k] = \str_replace(';', '\;', $v);
}
- $val = implode(';', $val);
+ $val = \implode(';', $val);
} else {
$val = $val[0];
}
@@ -242,7 +242,7 @@ class Text extends Property {
// If the resulting value contains a \n, we must encode it as
// quoted-printable.
- if (strpos($val, "\n") !== false) {
+ if (\strpos($val, "\n") !== false) {
$str .= ';ENCODING=QUOTED-PRINTABLE:';
$lastLine = $str;
@@ -252,40 +252,39 @@ class Text extends Property {
// encode newlines for us. Specifically, the \r\n sequence must in
// vcards be encoded as =0D=OA and we must insert soft-newlines
// every 75 bytes.
- for ($ii = 0;$ii < strlen($val);$ii++) {
- $ord = ord($val[$ii]);
+ for ($ii = 0;$ii < \strlen($val);$ii++) {
+ $ord = \ord($val[$ii]);
// These characters are encoded as themselves.
if ($ord >= 32 && $ord <= 126) {
$lastLine .= $val[$ii];
} else {
- $lastLine .= '=' . strtoupper(bin2hex($val[$ii]));
+ $lastLine .= '=' . \strtoupper(\bin2hex($val[$ii]));
}
- if (strlen($lastLine) >= 75) {
+ if (\strlen($lastLine) >= 75) {
// Soft line break
$out .= $lastLine . "=\r\n ";
$lastLine = null;
}
}
- if (!is_null($lastLine)) $out .= $lastLine . "\r\n";
+ if (!\is_null($lastLine)) $out .= $lastLine . "\r\n";
return $out;
} else {
$str .= ':' . $val;
- $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;
- }
- }
- return $out;
+ $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
+ );
+
+ // remove single space after last CRLF
+ return \substr($str, 0, -1);
}
diff --git a/vendor/sabre/vobject/lib/Version.php b/vendor/sabre/vobject/lib/Version.php
index 67e8a4037..074b06c4b 100644
--- a/vendor/sabre/vobject/lib/Version.php
+++ b/vendor/sabre/vobject/lib/Version.php
@@ -14,6 +14,6 @@ class Version {
/**
* Full version number.
*/
- const VERSION = '4.1.5';
+ const VERSION = '4.1.6';
}