aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre
diff options
context:
space:
mode:
authorKlaus Weidenbach <Klaus.Weidenbach@gmx.net>2016-10-17 23:26:48 +0200
committerKlaus Weidenbach <Klaus.Weidenbach@gmx.net>2016-10-18 18:11:41 +0200
commit745515b11f438d3658203aaaaf151c72e30d5e7c (patch)
treeed43b874f5519cf06a05a703e144fd6acad06d4b /vendor/sabre
parent17091bd38c4e4e5d8b1812dd1d9efeffe0046d02 (diff)
downloadvolse-hubzilla-745515b11f438d3658203aaaaf151c72e30d5e7c.tar.gz
volse-hubzilla-745515b11f438d3658203aaaaf151c72e30d5e7c.tar.bz2
volse-hubzilla-745515b11f438d3658203aaaaf151c72e30d5e7c.zip
[FEATURE] Add config and use composer autoloader.
We use composer already to install SabreDAV. Include config composer.(json|lock) to install and manage more dependencies in future. Also provide PSR-4 autoloading for our namespaced classes, e.g. "Zotlabs\". To regenerate autoloader maps use: $ composer install --optimize-autoloader --no-dev We could also remove the whole vendor/ folder from our repository, but that would need changes in deployment and how to install hubs and needs more discussion first.
Diffstat (limited to 'vendor/sabre')
-rw-r--r--vendor/sabre/dav/composer.json68
-rw-r--r--vendor/sabre/dav/lib/DAV/Browser/Plugin.php6
-rw-r--r--vendor/sabre/event/composer.json47
-rw-r--r--vendor/sabre/http/composer.json43
-rw-r--r--vendor/sabre/uri/composer.json41
-rw-r--r--vendor/sabre/vobject/.travis.yml5
-rw-r--r--vendor/sabre/vobject/CHANGELOG.md27
-rwxr-xr-x[-rw-r--r--]vendor/sabre/vobject/bin/bench.php0
-rwxr-xr-x[-rw-r--r--]vendor/sabre/vobject/bin/fetch_windows_zones.php0
-rwxr-xr-x[-rw-r--r--]vendor/sabre/vobject/bin/generateicalendardata.php2
-rwxr-xr-x[-rw-r--r--]vendor/sabre/vobject/bin/mergeduplicates.php2
-rw-r--r--vendor/sabre/vobject/composer.json88
-rw-r--r--vendor/sabre/vobject/lib/Component/VTimeZone.php3
-rw-r--r--vendor/sabre/vobject/lib/DateTimeParser.php13
-rw-r--r--vendor/sabre/vobject/lib/Property.php6
-rw-r--r--vendor/sabre/vobject/lib/Property/ICalendar/Recur.php24
-rw-r--r--vendor/sabre/vobject/lib/Property/Text.php2
-rw-r--r--vendor/sabre/vobject/lib/Recur/EventIterator.php12
-rw-r--r--vendor/sabre/vobject/lib/Recur/RRuleIterator.php5
-rw-r--r--vendor/sabre/vobject/lib/TimeZoneUtil.php10
-rw-r--r--vendor/sabre/vobject/lib/Version.php2
-rw-r--r--vendor/sabre/xml/.travis.yml15
-rw-r--r--vendor/sabre/xml/CHANGELOG.md11
-rw-r--r--vendor/sabre/xml/composer.json53
-rw-r--r--vendor/sabre/xml/lib/Element/XmlFragment.php2
-rw-r--r--vendor/sabre/xml/lib/Reader.php122
-rw-r--r--vendor/sabre/xml/lib/Version.php2
-rw-r--r--vendor/sabre/xml/lib/Writer.php2
28 files changed, 513 insertions, 100 deletions
diff --git a/vendor/sabre/dav/composer.json b/vendor/sabre/dav/composer.json
new file mode 100644
index 000000000..f85d9655e
--- /dev/null
+++ b/vendor/sabre/dav/composer.json
@@ -0,0 +1,68 @@
+{
+ "name": "sabre/dav",
+ "type": "library",
+ "description": "WebDAV Framework for PHP",
+ "keywords": ["Framework", "WebDAV", "CalDAV", "CardDAV", "iCalendar"],
+ "homepage": "http://sabre.io/",
+ "license" : "BSD-3-Clause",
+ "authors": [
+ {
+ "name": "Evert Pot",
+ "email": "me@evertpot.com",
+ "homepage" : "http://evertpot.com/",
+ "role" : "Developer"
+ }
+ ],
+ "require": {
+ "php": ">=5.5.0",
+ "sabre/vobject": "^4.1.0",
+ "sabre/event" : ">=2.0.0, <4.0.0",
+ "sabre/xml" : "^1.4.0",
+ "sabre/http" : "^4.2.1",
+ "sabre/uri" : "^1.0.1",
+ "ext-dom": "*",
+ "ext-pcre": "*",
+ "ext-spl": "*",
+ "ext-simplexml": "*",
+ "ext-mbstring" : "*",
+ "ext-ctype" : "*",
+ "ext-date" : "*",
+ "ext-iconv" : "*",
+ "lib-libxml" : ">=2.7.0",
+ "psr/log": "^1.0"
+ },
+ "require-dev" : {
+ "phpunit/phpunit" : "> 4.8, <=6.0.0",
+ "evert/phpdoc-md" : "~0.1.0",
+ "sabre/cs" : "~0.0.5",
+ "monolog/monolog": "^1.18"
+ },
+ "suggest" : {
+ "ext-curl" : "*",
+ "ext-pdo" : "*"
+ },
+ "autoload": {
+ "psr-4" : {
+ "Sabre\\DAV\\" : "lib/DAV/",
+ "Sabre\\DAVACL\\" : "lib/DAVACL/",
+ "Sabre\\CalDAV\\" : "lib/CalDAV/",
+ "Sabre\\CardDAV\\" : "lib/CardDAV/"
+ }
+ },
+ "support" : {
+ "forum" : "https://groups.google.com/group/sabredav-discuss",
+ "source" : "https://github.com/fruux/sabre-dav"
+ },
+ "bin" : [
+ "bin/sabredav",
+ "bin/naturalselection"
+ ],
+ "config" : {
+ "bin-dir" : "./bin"
+ },
+ "extra" : {
+ "branch-alias": {
+ "dev-master": "3.1.0-dev"
+ }
+ }
+}
diff --git a/vendor/sabre/dav/lib/DAV/Browser/Plugin.php b/vendor/sabre/dav/lib/DAV/Browser/Plugin.php
index 4959193ea..49359a045 100644
--- a/vendor/sabre/dav/lib/DAV/Browser/Plugin.php
+++ b/vendor/sabre/dav/lib/DAV/Browser/Plugin.php
@@ -163,7 +163,7 @@ class Plugin extends DAV\ServerPlugin {
* @return bool
*/
function httpPOST(RequestInterface $request, ResponseInterface $response) {
-
+
$contentType = $request->getHeader('Content-Type');
list($contentType) = explode(';', $contentType);
if ($contentType !== 'application/x-www-form-urlencoded' &&
@@ -179,7 +179,7 @@ class Plugin extends DAV\ServerPlugin {
if ($this->server->emit('onBrowserPostAction', [$uri, $postVars['sabreAction'], $postVars])) {
- switch ($postVars['sabreAction']) {
+ switch ($postVars['sabreAction']) {
case 'mkcol' :
if (isset($postVars['name']) && trim($postVars['name'])) {
@@ -221,7 +221,7 @@ class Plugin extends DAV\ServerPlugin {
if ($_FILES) $file = current($_FILES);
else break;
-
+
list(, $newName) = URLUtil::splitPath(trim($file['name']));
if (isset($postVars['name']) && trim($postVars['name']))
$newName = trim($postVars['name']);
diff --git a/vendor/sabre/event/composer.json b/vendor/sabre/event/composer.json
new file mode 100644
index 000000000..9a11b01aa
--- /dev/null
+++ b/vendor/sabre/event/composer.json
@@ -0,0 +1,47 @@
+{
+ "name": "sabre/event",
+ "description": "sabre/event is a library for lightweight event-based programming",
+ "keywords": [
+ "Events",
+ "EventEmitter",
+ "Promise",
+ "Hooks",
+ "Plugin",
+ "Signal",
+ "Async"
+ ],
+ "homepage": "http://sabre.io/event/",
+ "license": "BSD-3-Clause",
+ "require": {
+ "php": ">=5.5"
+ },
+ "authors": [
+ {
+ "name": "Evert Pot",
+ "email": "me@evertpot.com",
+ "homepage": "http://evertpot.com/",
+ "role": "Developer"
+ }
+ ],
+ "support": {
+ "forum": "https://groups.google.com/group/sabredav-discuss",
+ "source": "https://github.com/fruux/sabre-event"
+ },
+ "autoload": {
+ "psr-4": {
+ "Sabre\\Event\\": "lib/"
+ },
+ "files" : [
+ "lib/coroutine.php",
+ "lib/Loop/functions.php",
+ "lib/Promise/functions.php"
+ ]
+ },
+ "require-dev": {
+ "sabre/cs": "~0.0.4",
+ "phpunit/phpunit" : "*"
+ },
+ "config" : {
+ "bin-dir" : "bin/"
+ }
+}
diff --git a/vendor/sabre/http/composer.json b/vendor/sabre/http/composer.json
new file mode 100644
index 000000000..b061194cf
--- /dev/null
+++ b/vendor/sabre/http/composer.json
@@ -0,0 +1,43 @@
+{
+ "name": "sabre/http",
+ "description" : "The sabre/http library provides utilities for dealing with http requests and responses. ",
+ "keywords" : [ "HTTP" ],
+ "homepage" : "https://github.com/fruux/sabre-http",
+ "license" : "BSD-3-Clause",
+ "require" : {
+ "php" : ">=5.4",
+ "ext-mbstring" : "*",
+ "sabre/event" : ">=1.0.0,<4.0.0",
+ "sabre/uri" : "~1.0"
+ },
+ "require-dev" : {
+ "phpunit/phpunit" : "~4.3",
+ "sabre/cs" : "~0.0.1"
+ },
+ "suggest" : {
+ "ext-curl" : " to make http requests with the Client class"
+ },
+ "authors" : [
+ {
+ "name" : "Evert Pot",
+ "email" : "me@evertpot.com",
+ "homepage" : "http://evertpot.com/",
+ "role" : "Developer"
+ }
+ ],
+ "support" : {
+ "forum" : "https://groups.google.com/group/sabredav-discuss",
+ "source" : "https://github.com/fruux/sabre-http"
+ },
+ "autoload" : {
+ "files" : [
+ "lib/functions.php"
+ ],
+ "psr-4" : {
+ "Sabre\\HTTP\\" : "lib/"
+ }
+ },
+ "config" : {
+ "bin-dir" : "bin/"
+ }
+}
diff --git a/vendor/sabre/uri/composer.json b/vendor/sabre/uri/composer.json
new file mode 100644
index 000000000..7b48acb71
--- /dev/null
+++ b/vendor/sabre/uri/composer.json
@@ -0,0 +1,41 @@
+{
+ "name": "sabre/uri",
+ "description": "Functions for making sense out of URIs.",
+ "keywords": [
+ "URI",
+ "URL",
+ "rfc3986"
+ ],
+ "homepage": "http://sabre.io/uri/",
+ "license": "BSD-3-Clause",
+ "require": {
+ "php": ">=5.4.7"
+ },
+ "authors": [
+ {
+ "name": "Evert Pot",
+ "email": "me@evertpot.com",
+ "homepage": "http://evertpot.com/",
+ "role": "Developer"
+ }
+ ],
+ "support": {
+ "forum": "https://groups.google.com/group/sabredav-discuss",
+ "source": "https://github.com/fruux/sabre-uri"
+ },
+ "autoload": {
+ "files" : [
+ "lib/functions.php"
+ ],
+ "psr-4" : {
+ "Sabre\\Uri\\" : "lib/"
+ }
+ },
+ "require-dev": {
+ "sabre/cs": "~0.0.1",
+ "phpunit/phpunit" : "*"
+ },
+ "config" : {
+ "bin-dir" : "bin/"
+ }
+}
diff --git a/vendor/sabre/vobject/.travis.yml b/vendor/sabre/vobject/.travis.yml
index 06bbdf8a0..b7266a878 100644
--- a/vendor/sabre/vobject/.travis.yml
+++ b/vendor/sabre/vobject/.travis.yml
@@ -3,14 +3,9 @@ php:
- 5.5
- 5.6
- 7
- - hhvm
sudo: false
-matrix:
- allow_failures:
- - php: hhvm
-
script:
- phpunit --configuration tests/phpunit.xml
- ./bin/sabre-cs-fixer fix . --dry-run --diff
diff --git a/vendor/sabre/vobject/CHANGELOG.md b/vendor/sabre/vobject/CHANGELOG.md
index 0bd7d53bd..4c72680f8 100644
--- a/vendor/sabre/vobject/CHANGELOG.md
+++ b/vendor/sabre/vobject/CHANGELOG.md
@@ -1,6 +1,19 @@
ChangeLog
=========
+4.1.1 (2016-07-15)
+------------------
+
+* #327: Throwing `InvalidDataException` in more cases where invalid iCalendar
+ dates and times were provided. (@rsto)
+* #331: Fix dealing with multiple overridden instances falling on the same
+ date/time (@afedyk-sugarcrm).
+* #333: Fix endless loop on invalid `BYMONTH` values in recurrence.
+ (@PHPGangsta)
+* #339: Fixed a few `validate()` results when repair is off. (@PHPGangsta)
+* #338: Stripping invalid `BYMONTH=` rules during `validate()` (@PHPGangsta)
+* #336: Fix incorrect `BYSECOND=` validation. (@PHPGangsta)
+
4.1.0 (2016-04-06)
------------------
@@ -130,6 +143,20 @@ ChangeLog
and `IntegerValue` to allow PHP 7 compatibility.
+3.5.3 (????-??-??)
+------------------
+
+* #331: Fix dealing with multiple overridden instances falling on the same
+ date/time (@afedyk-sugarcrm).
+
+
+3.5.2 (2016-04-24)
+-----------------
+
+* #312: Backported a fix related to iTip processing of events with timezones,
+ without a master event.
+
+
3.5.1 (2016-04-06)
------------------
diff --git a/vendor/sabre/vobject/bin/bench.php b/vendor/sabre/vobject/bin/bench.php
index 807b40777..807b40777 100644..100755
--- a/vendor/sabre/vobject/bin/bench.php
+++ b/vendor/sabre/vobject/bin/bench.php
diff --git a/vendor/sabre/vobject/bin/fetch_windows_zones.php b/vendor/sabre/vobject/bin/fetch_windows_zones.php
index 1b1fdc37c..1b1fdc37c 100644..100755
--- a/vendor/sabre/vobject/bin/fetch_windows_zones.php
+++ b/vendor/sabre/vobject/bin/fetch_windows_zones.php
diff --git a/vendor/sabre/vobject/bin/generateicalendardata.php b/vendor/sabre/vobject/bin/generateicalendardata.php
index dfcf18780..a2df3c63a 100644..100755
--- a/vendor/sabre/vobject/bin/generateicalendardata.php
+++ b/vendor/sabre/vobject/bin/generateicalendardata.php
@@ -29,7 +29,7 @@ include __DIR__ . '/../vendor/autoload.php';
fwrite(STDERR, "Generating " . $events . " events\n");
-$currentDate = new DateTime('-' . round($events / 2) . ' days');
+$currentDate = new DateTime('-' . round($events / 2) . ' days');
$calendar = new VObject\Component\VCalendar();
diff --git a/vendor/sabre/vobject/bin/mergeduplicates.php b/vendor/sabre/vobject/bin/mergeduplicates.php
index 1662e7bf3..076524d36 100644..100755
--- a/vendor/sabre/vobject/bin/mergeduplicates.php
+++ b/vendor/sabre/vobject/bin/mergeduplicates.php
@@ -157,7 +157,7 @@ while ($vcard = $splitter->getNext()) {
// echo $newProp->serialize() . " does not appear in earlier vcard!\n";
$stats['Error']++;
- if ($debug) fwrite($debug, "Missing '" . $newProp->name . "' property in duplicate. Earlier vcard:\n" . $collectedNames[$fn]->serialize() . "\n\nLater:\n" . $vcard->serialize() . "\n\n");
+ if ($debug) fwrite($debug, "Missing '" . $newProp->name . "' property in duplicate. Earlier vcard:\n" . $collectedNames[$fn]->serialize() . "\n\nLater:\n" . $vcard->serialize() . "\n\n");
$vcard->destroy();
continue 2;
diff --git a/vendor/sabre/vobject/composer.json b/vendor/sabre/vobject/composer.json
new file mode 100644
index 000000000..bd6348a82
--- /dev/null
+++ b/vendor/sabre/vobject/composer.json
@@ -0,0 +1,88 @@
+{
+ "name": "sabre/vobject",
+ "description" : "The VObject library for PHP allows you to easily parse and manipulate iCalendar and vCard objects",
+ "keywords" : [
+ "iCalendar",
+ "iCal",
+ "vCalendar",
+ "vCard",
+ "jCard",
+ "jCal",
+ "ics",
+ "vcf",
+ "xCard",
+ "xCal",
+ "freebusy",
+ "recurrence",
+ "availability",
+ "rfc2425",
+ "rfc2426",
+ "rfc2739",
+ "rfc4770",
+ "rfc5545",
+ "rfc5546",
+ "rfc6321",
+ "rfc6350",
+ "rfc6351",
+ "rfc6474",
+ "rfc6638",
+ "rfc6715",
+ "rfc6868"
+ ],
+ "homepage" : "http://sabre.io/vobject/",
+ "license" : "BSD-3-Clause",
+ "require" : {
+ "php" : ">=5.5",
+ "ext-mbstring" : "*",
+ "sabre/xml" : "~1.1"
+ },
+ "require-dev" : {
+ "phpunit/phpunit" : "*",
+ "sabre/cs" : "~0.0.3"
+
+ },
+ "suggest" : {
+ "hoa/bench" : "If you would like to run the benchmark scripts"
+ },
+ "authors" : [
+ {
+ "name" : "Evert Pot",
+ "email" : "me@evertpot.com",
+ "homepage" : "http://evertpot.com/",
+ "role" : "Developer"
+ },
+ {
+ "name" : "Dominik Tobschall",
+ "email" : "dominik@fruux.com",
+ "homepage" : "http://tobschall.de/",
+ "role" : "Developer"
+ },
+ {
+ "name" : "Ivan Enderlin",
+ "email" : "ivan.enderlin@hoa-project.net",
+ "homepage" : "http://mnt.io/",
+ "role" : "Developer"
+ }
+ ],
+ "support" : {
+ "forum" : "https://groups.google.com/group/sabredav-discuss",
+ "source" : "https://github.com/fruux/sabre-vobject"
+ },
+ "autoload" : {
+ "psr-4" : {
+ "Sabre\\VObject\\" : "lib/"
+ }
+ },
+ "bin" : [
+ "bin/vobject",
+ "bin/generate_vcards"
+ ],
+ "extra" : {
+ "branch-alias" : {
+ "dev-master" : "4.0.x-dev"
+ }
+ },
+ "config" : {
+ "bin-dir" : "bin"
+ }
+}
diff --git a/vendor/sabre/vobject/lib/Component/VTimeZone.php b/vendor/sabre/vobject/lib/Component/VTimeZone.php
index d5d886947..f6eb6cba1 100644
--- a/vendor/sabre/vobject/lib/Component/VTimeZone.php
+++ b/vendor/sabre/vobject/lib/Component/VTimeZone.php
@@ -53,8 +53,7 @@ class VTimeZone extends VObject\Component {
'LAST-MODIFIED' => '?',
'TZURL' => '?',
- // At least 1 STANDARD or DAYLIGHT must appear, or more. But both
- // cannot appear in the same VTIMEZONE.
+ // At least 1 STANDARD or DAYLIGHT must appear.
//
// The validator is not specific yet to pick this up, so these
// rules are too loose.
diff --git a/vendor/sabre/vobject/lib/DateTimeParser.php b/vendor/sabre/vobject/lib/DateTimeParser.php
index fc568abb0..443bbb660 100644
--- a/vendor/sabre/vobject/lib/DateTimeParser.php
+++ b/vendor/sabre/vobject/lib/DateTimeParser.php
@@ -43,7 +43,12 @@ class DateTimeParser {
if ($matches[7] === 'Z' || is_null($tz)) {
$tz = new DateTimeZone('UTC');
}
- $date = new DateTimeImmutable($matches[1] . '-' . $matches[2] . '-' . $matches[3] . ' ' . $matches[4] . ':' . $matches[5] . ':' . $matches[6], $tz);
+
+ try {
+ $date = new DateTimeImmutable($matches[1] . '-' . $matches[2] . '-' . $matches[3] . ' ' . $matches[4] . ':' . $matches[5] . ':' . $matches[6], $tz);
+ } catch (\Exception $e) {
+ throw new InvalidDataException('The supplied iCalendar datetime value is incorrect: ' . $dt);
+ }
return $date;
@@ -70,7 +75,11 @@ class DateTimeParser {
$tz = new DateTimeZone('UTC');
}
- $date = new DateTimeImmutable($matches[1] . '-' . $matches[2] . '-' . $matches[3], $tz);
+ try {
+ $date = new DateTimeImmutable($matches[1] . '-' . $matches[2] . '-' . $matches[3], $tz);
+ } catch (\Exception $e) {
+ throw new InvalidDataException('The supplied iCalendar date value is incorrect: ' . $date);
+ }
return $date;
diff --git a/vendor/sabre/vobject/lib/Property.php b/vendor/sabre/vobject/lib/Property.php
index 112775131..1aaa3ed58 100644
--- a/vendor/sabre/vobject/lib/Property.php
+++ b/vendor/sabre/vobject/lib/Property.php
@@ -579,7 +579,7 @@ abstract class Property extends Node {
// Checking if the propertyname does not contain any invalid bytes.
if (!preg_match('/^([A-Z0-9-]+)$/', $this->name)) {
$warnings[] = [
- 'level' => 1,
+ 'level' => $options & self::REPAIR ? 1 : 3,
'message' => 'The propertyname: ' . $this->name . ' contains invalid characters. Only A-Z, 0-9 and - are allowed',
'node' => $this,
];
@@ -599,7 +599,7 @@ abstract class Property extends Node {
if ($this->root->getDocumentType() === Document::VCARD40) {
$warnings[] = [
- 'level' => 1,
+ 'level' => 3,
'message' => 'ENCODING parameter is not valid in vCard 4.',
'node' => $this
];
@@ -623,7 +623,7 @@ abstract class Property extends Node {
}
if ($allowedEncoding && !in_array(strtoupper($encoding), $allowedEncoding)) {
$warnings[] = [
- 'level' => 1,
+ 'level' => 3,
'message' => 'ENCODING=' . strtoupper($encoding) . ' is not valid for this document type.',
'node' => $this
];
diff --git a/vendor/sabre/vobject/lib/Property/ICalendar/Recur.php b/vendor/sabre/vobject/lib/Property/ICalendar/Recur.php
index a3c36dc64..8392a5cc1 100644
--- a/vendor/sabre/vobject/lib/Property/ICalendar/Recur.php
+++ b/vendor/sabre/vobject/lib/Property/ICalendar/Recur.php
@@ -260,21 +260,39 @@ class Recur extends Property {
foreach ($values as $key => $value) {
- if (empty($value)) {
+ if ($value === '') {
$warnings[] = [
- 'level' => $repair ? 3 : 1,
+ 'level' => $repair ? 1 : 3,
'message' => 'Invalid value for ' . $key . ' in ' . $this->name,
'node' => $this
];
if ($repair) {
unset($values[$key]);
}
+ } elseif ($key == 'BYMONTH') {
+ $byMonth = (array)$value;
+ foreach ($byMonth as $i => $v) {
+ if (!is_numeric($v) || (int)$v < 1 || (int)$v > 12) {
+ $warnings[] = [
+ 'level' => $repair ? 1 : 3,
+ 'message' => 'BYMONTH in RRULE must have value(s) between 1 and 12!',
+ 'node' => $this
+ ];
+ if ($repair) {
+ if (is_array($value)) {
+ unset($values[$key][$i]);
+ } else {
+ unset($values[$key]);
+ }
+ }
+ }
+ }
}
}
if (!isset($values['FREQ'])) {
$warnings[] = [
- 'level' => $repair ? 3 : 1,
+ 'level' => $repair ? 1 : 3,
'message' => 'FREQ is required in ' . $this->name,
'node' => $this
];
diff --git a/vendor/sabre/vobject/lib/Property/Text.php b/vendor/sabre/vobject/lib/Property/Text.php
index 2e16ac534..abc17563f 100644
--- a/vendor/sabre/vobject/lib/Property/Text.php
+++ b/vendor/sabre/vobject/lib/Property/Text.php
@@ -397,7 +397,7 @@ class Text extends Property {
if (count($parts) < $minimum) {
$warnings[] = [
'level' => $options & self::REPAIR ? 1 : 3,
- 'message' => 'The ' . $this->name . ' property must have at least ' . $minimum . ' values. It only has ' . count($parts),
+ 'message' => 'The ' . $this->name . ' property must have at least ' . $minimum . ' values. It only has ' . count($parts),
'node' => $this,
];
if ($options & self::REPAIR) {
diff --git a/vendor/sabre/vobject/lib/Recur/EventIterator.php b/vendor/sabre/vobject/lib/Recur/EventIterator.php
index 86c996aec..f91c336bc 100644
--- a/vendor/sabre/vobject/lib/Recur/EventIterator.php
+++ b/vendor/sabre/vobject/lib/Recur/EventIterator.php
@@ -325,7 +325,7 @@ class EventIterator implements \Iterator {
$index = [];
foreach ($this->overriddenEvents as $key => $event) {
$stamp = $event->DTSTART->getDateTime($this->timeZone)->getTimeStamp();
- $index[$stamp] = $key;
+ $index[$stamp][] = $key;
}
krsort($index);
$this->counter = 0;
@@ -372,8 +372,9 @@ class EventIterator implements \Iterator {
// overridden event may cut ahead.
if ($this->overriddenEventsIndex) {
- $offset = end($this->overriddenEventsIndex);
+ $offsets = end($this->overriddenEventsIndex);
$timestamp = key($this->overriddenEventsIndex);
+ $offset = end($offsets);
if (!$nextDate || $timestamp < $nextDate->getTimeStamp()) {
// Overridden event comes first.
$this->currentOverriddenEvent = $this->overriddenEvents[$offset];
@@ -383,7 +384,10 @@ class EventIterator implements \Iterator {
$this->currentDate = $this->currentOverriddenEvent->DTSTART->getDateTime($this->timeZone);
// Ensuring that this item will only be used once.
- array_pop($this->overriddenEventsIndex);
+ array_pop($this->overriddenEventsIndex[$timestamp]);
+ if (!$this->overriddenEventsIndex[$timestamp]) {
+ array_pop($this->overriddenEventsIndex);
+ }
// Exit point!
return;
@@ -451,7 +455,7 @@ class EventIterator implements \Iterator {
/**
* Overridden event index.
*
- * Key is timestamp, value is the index of the item in the $overriddenEvent
+ * Key is timestamp, value is the list of indexes of the item in the $overriddenEvent
* property.
*
* @var array
diff --git a/vendor/sabre/vobject/lib/Recur/RRuleIterator.php b/vendor/sabre/vobject/lib/Recur/RRuleIterator.php
index 402e2de83..4c89f3ce4 100644
--- a/vendor/sabre/vobject/lib/Recur/RRuleIterator.php
+++ b/vendor/sabre/vobject/lib/Recur/RRuleIterator.php
@@ -718,6 +718,11 @@ class RRuleIterator implements Iterator {
case 'BYMONTH' :
$this->byMonth = (array)$value;
+ foreach ($this->byMonth as $byMonth) {
+ if (!is_numeric($byMonth) || (int)$byMonth < 1 || (int)$byMonth > 12) {
+ throw new InvalidDataException('BYMONTH in RRULE must have value(s) betweeen 1 and 12!');
+ }
+ }
break;
case 'BYSETPOS' :
diff --git a/vendor/sabre/vobject/lib/TimeZoneUtil.php b/vendor/sabre/vobject/lib/TimeZoneUtil.php
index 4873daf92..2a95ae898 100644
--- a/vendor/sabre/vobject/lib/TimeZoneUtil.php
+++ b/vendor/sabre/vobject/lib/TimeZoneUtil.php
@@ -240,10 +240,10 @@ class TimeZoneUtil {
if (!is_null(self::$map)) return;
self::$map = array_merge(
- include __DIR__ . '/timezonedata/windowszones.php',
- include __DIR__ . '/timezonedata/lotuszones.php',
- include __DIR__ . '/timezonedata/exchangezones.php',
- include __DIR__ . '/timezonedata/php-workaround.php'
+ include __DIR__ . '/timezonedata/windowszones.php',
+ include __DIR__ . '/timezonedata/lotuszones.php',
+ include __DIR__ . '/timezonedata/exchangezones.php',
+ include __DIR__ . '/timezonedata/php-workaround.php'
);
}
@@ -260,7 +260,7 @@ class TimeZoneUtil {
* @return array
*/
static function getIdentifiersBC() {
- return include __DIR__ . '/timezonedata/php-bc.php';
+ return include __DIR__ . '/timezonedata/php-bc.php';
}
}
diff --git a/vendor/sabre/vobject/lib/Version.php b/vendor/sabre/vobject/lib/Version.php
index 0b0e16c03..ca9f21960 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.0';
+ const VERSION = '4.1.1';
}
diff --git a/vendor/sabre/xml/.travis.yml b/vendor/sabre/xml/.travis.yml
index 9bba4d451..96396564e 100644
--- a/vendor/sabre/xml/.travis.yml
+++ b/vendor/sabre/xml/.travis.yml
@@ -1,11 +1,9 @@
language: php
php:
- - 5.4
- 5.5
- 5.6
- - 7
- - nightly
- - hhvm
+ - 7.0
+ - 7.1
matrix:
fast_finish: true
@@ -16,10 +14,13 @@ cache:
directories:
- $HOME/.composer/cache
+before_install:
+ - phpenv config-rm xdebug.ini; true
+
+install:
+ - composer install
+
script:
- ./bin/phpunit --configuration tests/phpunit.xml.dist
- ./bin/sabre-cs-fixer fix . --dry-run --diff
-before_script:
- - phpenv config-rm xdebug.ini; true
- - composer install
diff --git a/vendor/sabre/xml/CHANGELOG.md b/vendor/sabre/xml/CHANGELOG.md
index a8085401b..39a39bffe 100644
--- a/vendor/sabre/xml/CHANGELOG.md
+++ b/vendor/sabre/xml/CHANGELOG.md
@@ -1,7 +1,16 @@
ChangeLog
=========
-1.4.2 (????-??-??)
+1.5.0 (2016-10-09)
+------------------
+
+* Now requires PHP 5.5.
+* Using `finally` to always roll back the context stack when serializing.
+* #94: Fixed an infinite loop condition when reading some invalid XML
+ documents.
+
+
+1.4.2 (2016-05-19)
------------------
* The `contextStack` in the Reader object is now correctly rolled back in
diff --git a/vendor/sabre/xml/composer.json b/vendor/sabre/xml/composer.json
new file mode 100644
index 000000000..386f8213f
--- /dev/null
+++ b/vendor/sabre/xml/composer.json
@@ -0,0 +1,53 @@
+{
+ "name": "sabre/xml",
+ "description" : "sabre/xml is an XML library that you may not hate.",
+ "keywords" : [ "XML", "XMLReader", "XMLWriter", "DOM" ],
+ "homepage" : "https://sabre.io/xml/",
+ "license" : "BSD-3-Clause",
+ "require" : {
+ "php" : ">=5.5.5",
+ "ext-xmlwriter" : "*",
+ "ext-xmlreader" : "*",
+ "ext-dom" : "*",
+ "lib-libxml" : ">=2.6.20",
+ "sabre/uri" : ">=1.0,<3.0.0"
+ },
+ "authors" : [
+ {
+ "name" : "Evert Pot",
+ "email" : "me@evertpot.com",
+ "homepage" : "http://evertpot.com/",
+ "role" : "Developer"
+ },
+ {
+ "name": "Markus Staab",
+ "email": "markus.staab@redaxo.de",
+ "role" : "Developer"
+ }
+ ],
+ "support" : {
+ "forum" : "https://groups.google.com/group/sabredav-discuss",
+ "source" : "https://github.com/fruux/sabre-xml"
+ },
+ "autoload" : {
+ "psr-4" : {
+ "Sabre\\Xml\\" : "lib/"
+ },
+ "files": [
+ "lib/Deserializer/functions.php",
+ "lib/Serializer/functions.php"
+ ]
+ },
+ "autoload-dev" : {
+ "psr-4" : {
+ "Sabre\\Xml\\" : "tests/Sabre/Xml/"
+ }
+ },
+ "require-dev": {
+ "sabre/cs": "~1.0.0",
+ "phpunit/phpunit" : "*"
+ },
+ "config" : {
+ "bin-dir" : "bin/"
+ }
+}
diff --git a/vendor/sabre/xml/lib/Element/XmlFragment.php b/vendor/sabre/xml/lib/Element/XmlFragment.php
index 0abfac132..642241ca4 100644
--- a/vendor/sabre/xml/lib/Element/XmlFragment.php
+++ b/vendor/sabre/xml/lib/Element/XmlFragment.php
@@ -2,9 +2,9 @@
namespace Sabre\Xml\Element;
+use Sabre\Xml\Element;
use Sabre\Xml\Reader;
use Sabre\Xml\Writer;
-use Sabre\Xml\Element;
/**
* The XmlFragment element allows you to extract a portion of your xml tree,
diff --git a/vendor/sabre/xml/lib/Reader.php b/vendor/sabre/xml/lib/Reader.php
index f35dc8537..92e5dba96 100644
--- a/vendor/sabre/xml/lib/Reader.php
+++ b/vendor/sabre/xml/lib/Reader.php
@@ -59,22 +59,26 @@ class Reader extends XMLReader {
$previousEntityState = libxml_disable_entity_loader(true);
$previousSetting = libxml_use_internal_errors(true);
- // Really sorry about the silence operator, seems like I have no
- // choice. See:
- //
- // https://bugs.php.net/bug.php?id=64230
- while ($this->nodeType !== self::ELEMENT && @$this->read()) {
- // noop
- }
- $result = $this->parseCurrentElement();
+ try {
+
+ // Really sorry about the silence operator, seems like I have no
+ // choice. See:
+ //
+ // https://bugs.php.net/bug.php?id=64230
+ while ($this->nodeType !== self::ELEMENT && @$this->read()) {
+ // noop
+ }
+ $result = $this->parseCurrentElement();
- $errors = libxml_get_errors();
- libxml_clear_errors();
- libxml_use_internal_errors($previousSetting);
- libxml_disable_entity_loader($previousEntityState);
+ $errors = libxml_get_errors();
+ libxml_clear_errors();
+ if ($errors) {
+ throw new LibXMLException($errors);
+ }
- if ($errors) {
- throw new LibXMLException($errors);
+ } finally {
+ libxml_use_internal_errors($previousSetting);
+ libxml_disable_entity_loader($previousEntityState);
}
return $result;
@@ -138,60 +142,62 @@ class Reader extends XMLReader {
$this->elementMap = $elementMap;
}
- // Really sorry about the silence operator, seems like I have no
- // choice. See:
- //
- // https://bugs.php.net/bug.php?id=64230
- if (!@$this->read()) {
- if (!is_null($elementMap)) {
- $this->popContext();
- }
- return false;
- }
-
- while (true) {
-
- if (!$this->isValid()) {
+ try {
+ // Really sorry about the silence operator, seems like I have no
+ // choice. See:
+ //
+ // https://bugs.php.net/bug.php?id=64230
+ if (!@$this->read()) {
$errors = libxml_get_errors();
-
+ libxml_clear_errors();
if ($errors) {
- libxml_clear_errors();
- if (!is_null($elementMap)) {
- $this->popContext();
- }
throw new LibXMLException($errors);
}
+ throw new ParseException('This should never happen (famous last words)');
}
- switch ($this->nodeType) {
- case self::ELEMENT :
- $elements[] = $this->parseCurrentElement();
- break;
- case self::TEXT :
- case self::CDATA :
- $text .= $this->value;
- $this->read();
- break;
- case self::END_ELEMENT :
- // Ensuring we are moving the cursor after the end element.
- $this->read();
- break 2;
- case self::NONE :
- if (!is_null($elementMap)) {
- $this->popContext();
+ while (true) {
+
+ if (!$this->isValid()) {
+
+ $errors = libxml_get_errors();
+
+ if ($errors) {
+ libxml_clear_errors();
+ throw new LibXMLException($errors);
}
- throw new ParseException('We hit the end of the document prematurely. This likely means that some parser "eats" too many elements. Do not attempt to continue parsing.');
- default :
- // Advance to the next element
- $this->read();
- break;
+ }
+
+ switch ($this->nodeType) {
+ case self::ELEMENT :
+ $elements[] = $this->parseCurrentElement();
+ break;
+ case self::TEXT :
+ case self::CDATA :
+ $text .= $this->value;
+ $this->read();
+ break;
+ case self::END_ELEMENT :
+ // Ensuring we are moving the cursor after the end element.
+ $this->read();
+ break 2;
+ case self::NONE :
+ throw new ParseException('We hit the end of the document prematurely. This likely means that some parser "eats" too many elements. Do not attempt to continue parsing.');
+ default :
+ // Advance to the next element
+ $this->read();
+ break;
+ }
+
}
- }
+ } finally {
+
+ if (!is_null($elementMap)) {
+ $this->popContext();
+ }
- if (!is_null($elementMap)) {
- $this->popContext();
}
return ($elements ? $elements : $text);
@@ -304,7 +310,7 @@ class Reader extends XMLReader {
$deserializer = $this->elementMap[$name];
if (is_subclass_of($deserializer, 'Sabre\\Xml\\XmlDeserializable')) {
- return [ $deserializer, 'xmlDeserialize' ];
+ return [$deserializer, 'xmlDeserialize'];
}
if (is_callable($deserializer)) {
diff --git a/vendor/sabre/xml/lib/Version.php b/vendor/sabre/xml/lib/Version.php
index f199e7158..7edb40d67 100644
--- a/vendor/sabre/xml/lib/Version.php
+++ b/vendor/sabre/xml/lib/Version.php
@@ -14,6 +14,6 @@ class Version {
/**
* Full version number
*/
- const VERSION = '1.4.1';
+ const VERSION = '1.5.0';
}
diff --git a/vendor/sabre/xml/lib/Writer.php b/vendor/sabre/xml/lib/Writer.php
index adfbe0cb0..09d4cb321 100644
--- a/vendor/sabre/xml/lib/Writer.php
+++ b/vendor/sabre/xml/lib/Writer.php
@@ -127,7 +127,7 @@ class Writer extends XMLWriter {
if (array_key_exists($namespace, $this->namespaceMap)) {
$result = $this->startElementNS(
- $this->namespaceMap[$namespace] === '' ? null : $this->namespaceMap[$namespace],
+ $this->namespaceMap[$namespace] === '' ? null : $this->namespaceMap[$namespace],
$localName,
null
);