upgrade to sabre32
This commit is contained in:
20
vendor/sabre/xml/lib/Reader.php
vendored
20
vendor/sabre/xml/lib/Reader.php
vendored
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user