diff options
Diffstat (limited to 'vendor/sabre/xml')
-rw-r--r-- | vendor/sabre/xml/.travis.yml | 15 | ||||
-rw-r--r-- | vendor/sabre/xml/CHANGELOG.md | 11 | ||||
-rw-r--r-- | vendor/sabre/xml/composer.json | 53 | ||||
-rw-r--r-- | vendor/sabre/xml/lib/Element/XmlFragment.php | 2 | ||||
-rw-r--r-- | vendor/sabre/xml/lib/Reader.php | 122 | ||||
-rw-r--r-- | vendor/sabre/xml/lib/Version.php | 2 | ||||
-rw-r--r-- | vendor/sabre/xml/lib/Writer.php | 2 |
7 files changed, 138 insertions, 69 deletions
diff --git a/vendor/sabre/xml/.travis.yml b/vendor/sabre/xml/.travis.yml index 9bba4d451..96396564e 100644 --- a/vendor/sabre/xml/.travis.yml +++ b/vendor/sabre/xml/.travis.yml @@ -1,11 +1,9 @@ language: php php: - - 5.4 - 5.5 - 5.6 - - 7 - - nightly - - hhvm + - 7.0 + - 7.1 matrix: fast_finish: true @@ -16,10 +14,13 @@ cache: directories: - $HOME/.composer/cache +before_install: + - phpenv config-rm xdebug.ini; true + +install: + - composer install + script: - ./bin/phpunit --configuration tests/phpunit.xml.dist - ./bin/sabre-cs-fixer fix . --dry-run --diff -before_script: - - phpenv config-rm xdebug.ini; true - - composer install diff --git a/vendor/sabre/xml/CHANGELOG.md b/vendor/sabre/xml/CHANGELOG.md index a8085401b..39a39bffe 100644 --- a/vendor/sabre/xml/CHANGELOG.md +++ b/vendor/sabre/xml/CHANGELOG.md @@ -1,7 +1,16 @@ ChangeLog ========= -1.4.2 (????-??-??) +1.5.0 (2016-10-09) +------------------ + +* Now requires PHP 5.5. +* Using `finally` to always roll back the context stack when serializing. +* #94: Fixed an infinite loop condition when reading some invalid XML + documents. + + +1.4.2 (2016-05-19) ------------------ * The `contextStack` in the Reader object is now correctly rolled back in diff --git a/vendor/sabre/xml/composer.json b/vendor/sabre/xml/composer.json new file mode 100644 index 000000000..386f8213f --- /dev/null +++ b/vendor/sabre/xml/composer.json @@ -0,0 +1,53 @@ +{ + "name": "sabre/xml", + "description" : "sabre/xml is an XML library that you may not hate.", + "keywords" : [ "XML", "XMLReader", "XMLWriter", "DOM" ], + "homepage" : "https://sabre.io/xml/", + "license" : "BSD-3-Clause", + "require" : { + "php" : ">=5.5.5", + "ext-xmlwriter" : "*", + "ext-xmlreader" : "*", + "ext-dom" : "*", + "lib-libxml" : ">=2.6.20", + "sabre/uri" : ">=1.0,<3.0.0" + }, + "authors" : [ + { + "name" : "Evert Pot", + "email" : "me@evertpot.com", + "homepage" : "http://evertpot.com/", + "role" : "Developer" + }, + { + "name": "Markus Staab", + "email": "markus.staab@redaxo.de", + "role" : "Developer" + } + ], + "support" : { + "forum" : "https://groups.google.com/group/sabredav-discuss", + "source" : "https://github.com/fruux/sabre-xml" + }, + "autoload" : { + "psr-4" : { + "Sabre\\Xml\\" : "lib/" + }, + "files": [ + "lib/Deserializer/functions.php", + "lib/Serializer/functions.php" + ] + }, + "autoload-dev" : { + "psr-4" : { + "Sabre\\Xml\\" : "tests/Sabre/Xml/" + } + }, + "require-dev": { + "sabre/cs": "~1.0.0", + "phpunit/phpunit" : "*" + }, + "config" : { + "bin-dir" : "bin/" + } +} diff --git a/vendor/sabre/xml/lib/Element/XmlFragment.php b/vendor/sabre/xml/lib/Element/XmlFragment.php index 0abfac132..642241ca4 100644 --- a/vendor/sabre/xml/lib/Element/XmlFragment.php +++ b/vendor/sabre/xml/lib/Element/XmlFragment.php @@ -2,9 +2,9 @@ namespace Sabre\Xml\Element; +use Sabre\Xml\Element; use Sabre\Xml\Reader; use Sabre\Xml\Writer; -use Sabre\Xml\Element; /** * The XmlFragment element allows you to extract a portion of your xml tree, diff --git a/vendor/sabre/xml/lib/Reader.php b/vendor/sabre/xml/lib/Reader.php index f35dc8537..92e5dba96 100644 --- a/vendor/sabre/xml/lib/Reader.php +++ b/vendor/sabre/xml/lib/Reader.php @@ -59,22 +59,26 @@ class Reader extends XMLReader { $previousEntityState = libxml_disable_entity_loader(true); $previousSetting = libxml_use_internal_errors(true); - // Really sorry about the silence operator, seems like I have no - // choice. See: - // - // https://bugs.php.net/bug.php?id=64230 - while ($this->nodeType !== self::ELEMENT && @$this->read()) { - // noop - } - $result = $this->parseCurrentElement(); + try { + + // Really sorry about the silence operator, seems like I have no + // choice. See: + // + // https://bugs.php.net/bug.php?id=64230 + while ($this->nodeType !== self::ELEMENT && @$this->read()) { + // noop + } + $result = $this->parseCurrentElement(); - $errors = libxml_get_errors(); - libxml_clear_errors(); - libxml_use_internal_errors($previousSetting); - libxml_disable_entity_loader($previousEntityState); + $errors = libxml_get_errors(); + libxml_clear_errors(); + if ($errors) { + throw new LibXMLException($errors); + } - if ($errors) { - throw new LibXMLException($errors); + } finally { + libxml_use_internal_errors($previousSetting); + libxml_disable_entity_loader($previousEntityState); } return $result; @@ -138,60 +142,62 @@ class Reader extends XMLReader { $this->elementMap = $elementMap; } - // Really sorry about the silence operator, seems like I have no - // choice. See: - // - // https://bugs.php.net/bug.php?id=64230 - if (!@$this->read()) { - if (!is_null($elementMap)) { - $this->popContext(); - } - return false; - } - - while (true) { - - if (!$this->isValid()) { + try { + // Really sorry about the silence operator, seems like I have no + // choice. See: + // + // https://bugs.php.net/bug.php?id=64230 + if (!@$this->read()) { $errors = libxml_get_errors(); - + libxml_clear_errors(); if ($errors) { - libxml_clear_errors(); - if (!is_null($elementMap)) { - $this->popContext(); - } throw new LibXMLException($errors); } + throw new ParseException('This should never happen (famous last words)'); } - switch ($this->nodeType) { - case self::ELEMENT : - $elements[] = $this->parseCurrentElement(); - break; - case self::TEXT : - case self::CDATA : - $text .= $this->value; - $this->read(); - break; - case self::END_ELEMENT : - // Ensuring we are moving the cursor after the end element. - $this->read(); - break 2; - case self::NONE : - if (!is_null($elementMap)) { - $this->popContext(); + while (true) { + + if (!$this->isValid()) { + + $errors = libxml_get_errors(); + + if ($errors) { + libxml_clear_errors(); + throw new LibXMLException($errors); } - 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 - $this->read(); - break; + } + + switch ($this->nodeType) { + case self::ELEMENT : + $elements[] = $this->parseCurrentElement(); + break; + case self::TEXT : + case self::CDATA : + $text .= $this->value; + $this->read(); + break; + case self::END_ELEMENT : + // Ensuring we are moving the cursor after the end element. + $this->read(); + break 2; + case self::NONE : + 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 + $this->read(); + break; + } + } - } + } finally { + + if (!is_null($elementMap)) { + $this->popContext(); + } - if (!is_null($elementMap)) { - $this->popContext(); } return ($elements ? $elements : $text); @@ -304,7 +310,7 @@ class Reader extends XMLReader { $deserializer = $this->elementMap[$name]; if (is_subclass_of($deserializer, 'Sabre\\Xml\\XmlDeserializable')) { - return [ $deserializer, 'xmlDeserialize' ]; + return [$deserializer, 'xmlDeserialize']; } if (is_callable($deserializer)) { diff --git a/vendor/sabre/xml/lib/Version.php b/vendor/sabre/xml/lib/Version.php index f199e7158..7edb40d67 100644 --- a/vendor/sabre/xml/lib/Version.php +++ b/vendor/sabre/xml/lib/Version.php @@ -14,6 +14,6 @@ class Version { /** * Full version number */ - const VERSION = '1.4.1'; + const VERSION = '1.5.0'; } diff --git a/vendor/sabre/xml/lib/Writer.php b/vendor/sabre/xml/lib/Writer.php index adfbe0cb0..09d4cb321 100644 --- a/vendor/sabre/xml/lib/Writer.php +++ b/vendor/sabre/xml/lib/Writer.php @@ -127,7 +127,7 @@ class Writer extends XMLWriter { if (array_key_exists($namespace, $this->namespaceMap)) { $result = $this->startElementNS( - $this->namespaceMap[$namespace] === '' ? null : $this->namespaceMap[$namespace], + $this->namespaceMap[$namespace] === '' ? null : $this->namespaceMap[$namespace], $localName, null ); |