aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/xml/lib/Deserializer
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2019-06-26 21:54:50 -0700
committerzotlabs <mike@macgirvin.com>2019-06-26 21:54:50 -0700
commitd83ce0863abaf448b64c550999e070376fd71b71 (patch)
treea0f0b45249487bd471bcf0545dfbb23f7b871623 /vendor/sabre/xml/lib/Deserializer
parentcf844cb27c02c3aae636eb1aa1587b1d5e3e81a0 (diff)
parent5ccef18d4e5b7901f78a11e0124c16e1c484e3bf (diff)
downloadvolse-hubzilla-d83ce0863abaf448b64c550999e070376fd71b71.tar.gz
volse-hubzilla-d83ce0863abaf448b64c550999e070376fd71b71.tar.bz2
volse-hubzilla-d83ce0863abaf448b64c550999e070376fd71b71.zip
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
Diffstat (limited to 'vendor/sabre/xml/lib/Deserializer')
-rw-r--r--vendor/sabre/xml/lib/Deserializer/functions.php33
1 files changed, 29 insertions, 4 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);