diff options
author | Mario Vavti <mario@mariovavti.com> | 2016-05-28 17:46:24 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2016-05-28 17:46:24 +0200 |
commit | 66effbfe0827fc61fff6d248797a894213ad20d6 (patch) | |
tree | 0fbb5ca644e1140e5b3b44b1adc874043790c388 /vendor/sabre/xml/lib/Reader.php | |
parent | ac4688eac087854bf8cb0c893d7a79052ad63a20 (diff) | |
download | volse-hubzilla-66effbfe0827fc61fff6d248797a894213ad20d6.tar.gz volse-hubzilla-66effbfe0827fc61fff6d248797a894213ad20d6.tar.bz2 volse-hubzilla-66effbfe0827fc61fff6d248797a894213ad20d6.zip |
upgrade to sabre32
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]; |