aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/xml/lib
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/sabre/xml/lib')
-rw-r--r--vendor/sabre/xml/lib/Deserializer/functions.php33
-rw-r--r--vendor/sabre/xml/lib/Service.php3
2 files changed, 31 insertions, 5 deletions
diff --git a/vendor/sabre/xml/lib/Deserializer/functions.php b/vendor/sabre/xml/lib/Deserializer/functions.php
index 2e5d877e9..07038d99a 100644
--- a/vendor/sabre/xml/lib/Deserializer/functions.php
+++ b/vendor/sabre/xml/lib/Deserializer/functions.php
@@ -66,9 +66,20 @@ function keyValue(Reader $reader, $namespace = null) {
return [];
}
+ if (!$reader->read()) {
+ $reader->next();
+
+ return [];
+ }
+
+ if (Reader::END_ELEMENT === $reader->nodeType) {
+ $reader->next();
+
+ return [];
+ }
+
$values = [];
- $reader->read();
do {
if ($reader->nodeType === Reader::ELEMENT) {
@@ -79,7 +90,9 @@ function keyValue(Reader $reader, $namespace = null) {
$values[$clark] = $reader->parseCurrentElement()['value'];
}
} else {
- $reader->read();
+ if (!$reader->read()) {
+ break;
+ }
}
} while ($reader->nodeType !== Reader::END_ELEMENT);
@@ -144,7 +157,17 @@ function enum(Reader $reader, $namespace = null) {
$reader->next();
return [];
}
- $reader->read();
+ if (!$reader->read()) {
+ $reader->next();
+
+ return [];
+ }
+
+ if (Reader::END_ELEMENT === $reader->nodeType) {
+ $reader->next();
+
+ return [];
+ }
$currentDepth = $reader->depth;
$values = [];
@@ -204,7 +227,9 @@ function valueObject(Reader $reader, $className, $namespace) {
$reader->next();
}
} else {
- $reader->read();
+ if (!$reader->read()) {
+ break;
+ }
}
} while ($reader->nodeType !== Reader::END_ELEMENT);
diff --git a/vendor/sabre/xml/lib/Service.php b/vendor/sabre/xml/lib/Service.php
index 09ee341cf..acea94ea9 100644
--- a/vendor/sabre/xml/lib/Service.php
+++ b/vendor/sabre/xml/lib/Service.php
@@ -138,7 +138,8 @@ class Service {
* @param string|string[] $rootElementName
* @param string|resource $input
* @param string|null $contextUri
- * @return void
+ * @throws ParseException
+ * @return array|object|string
*/
function expect($rootElementName, $input, $contextUri = null) {