diff options
author | Andrew Manning <tamanning@zoho.com> | 2016-06-30 21:51:33 -0400 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2016-06-30 21:51:33 -0400 |
commit | 0fd8eeec23a0613db8ea6c5bb54b4658ddaa0e61 (patch) | |
tree | b6684b05aee92729406a90f397ccd446f58863c7 /vendor/sabre/xml/lib/Reader.php | |
parent | 7124c0aee5486aab74272c81ceb3e383b2e3a7f7 (diff) | |
parent | 852b2659e9a71f0542e822aa20efc009e22ff66a (diff) | |
download | volse-hubzilla-0fd8eeec23a0613db8ea6c5bb54b4658ddaa0e61.tar.gz volse-hubzilla-0fd8eeec23a0613db8ea6c5bb54b4658ddaa0e61.tar.bz2 volse-hubzilla-0fd8eeec23a0613db8ea6c5bb54b4658ddaa0e61.zip |
Merge remote-tracking branch 'upstream/dev' into wiki
Diffstat (limited to 'vendor/sabre/xml/lib/Reader.php')
-rw-r--r-- | vendor/sabre/xml/lib/Reader.php | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/vendor/sabre/xml/lib/Reader.php b/vendor/sabre/xml/lib/Reader.php index 7cba76c59..f35dc8537 100644 --- a/vendor/sabre/xml/lib/Reader.php +++ b/vendor/sabre/xml/lib/Reader.php @@ -142,7 +142,12 @@ class Reader extends XMLReader { // choice. See: // // https://bugs.php.net/bug.php?id=64230 - if (!@$this->read()) return false; + if (!@$this->read()) { + if (!is_null($elementMap)) { + $this->popContext(); + } + return false; + } while (true) { @@ -152,6 +157,9 @@ class Reader extends XMLReader { if ($errors) { libxml_clear_errors(); + if (!is_null($elementMap)) { + $this->popContext(); + } throw new LibXMLException($errors); } } @@ -170,6 +178,9 @@ class Reader extends XMLReader { $this->read(); break 2; case self::NONE : + if (!is_null($elementMap)) { + $this->popContext(); + } 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 @@ -282,8 +293,13 @@ class Reader extends XMLReader { */ function getDeserializerForElementName($name) { + if (!array_key_exists($name, $this->elementMap)) { - return ['Sabre\\Xml\\Element\\Base', 'xmlDeserialize']; + if (substr($name, 0, 2) == '{}' && array_key_exists(substr($name, 2), $this->elementMap)) { + $name = substr($name, 2); + } else { + return ['Sabre\\Xml\\Element\\Base', 'xmlDeserialize']; + } } $deserializer = $this->elementMap[$name]; |