diff --git a/snappymail/v/0.0.0/app/libraries/Sabre/Xml/Deserializer/functions.php b/snappymail/v/0.0.0/app/libraries/Sabre/Xml/Deserializer/functions.php index 5531f7621..949aa720e 100644 --- a/snappymail/v/0.0.0/app/libraries/Sabre/Xml/Deserializer/functions.php +++ b/snappymail/v/0.0.0/app/libraries/Sabre/Xml/Deserializer/functions.php @@ -57,7 +57,7 @@ use Sabre\Xml\Reader; * * @phpstan-return array */ -function keyValue(Reader $reader, string $namespace = null): array +function keyValue(Reader $reader, ?string $namespace = null): array { // If there's no children, we don't do anything. if ($reader->isEmptyElement) { @@ -148,7 +148,7 @@ function keyValue(Reader $reader, string $namespace = null): array * * @phpstan-return list */ -function enum(Reader $reader, string $namespace = null): array +function enum(Reader $reader, ?string $namespace = null): array { // If there's no children, we don't do anything. if ($reader->isEmptyElement) { @@ -223,6 +223,9 @@ function valueObject(Reader $reader, string $className, string $namespace): obje // Ignore property $reader->next(); } + } elseif (Reader::ELEMENT === $reader->nodeType) { + // Skipping element from different namespace + $reader->next(); } else { if (Reader::END_ELEMENT !== $reader->nodeType && !$reader->read()) { break; diff --git a/snappymail/v/0.0.0/app/libraries/Sabre/Xml/LibXMLException.php b/snappymail/v/0.0.0/app/libraries/Sabre/Xml/LibXMLException.php index 9b5332b3b..5c642a3bf 100644 --- a/snappymail/v/0.0.0/app/libraries/Sabre/Xml/LibXMLException.php +++ b/snappymail/v/0.0.0/app/libraries/Sabre/Xml/LibXMLException.php @@ -31,7 +31,7 @@ class LibXMLException extends ParseException * * @param \LibXMLError[] $errors */ - public function __construct(array $errors, int $code = 0, \Throwable $previousException = null) + public function __construct(array $errors, int $code = 0, ?\Throwable $previousException = null) { $this->errors = $errors; parent::__construct($errors[0]->message.' on line '.$errors[0]->line.', column '.$errors[0]->column, $code, $previousException); diff --git a/snappymail/v/0.0.0/app/libraries/Sabre/Xml/Reader.php b/snappymail/v/0.0.0/app/libraries/Sabre/Xml/Reader.php index 53d64d54d..a85bd058c 100644 --- a/snappymail/v/0.0.0/app/libraries/Sabre/Xml/Reader.php +++ b/snappymail/v/0.0.0/app/libraries/Sabre/Xml/Reader.php @@ -107,7 +107,7 @@ class Reader extends \XMLReader * * @return array> */ - public function parseGetElements(array $elementMap = null): array + public function parseGetElements(?array $elementMap = null): array { $result = $this->parseInnerTree($elementMap); if (!is_array($result)) { @@ -132,7 +132,7 @@ class Reader extends \XMLReader * * @return array>|string|null */ - public function parseInnerTree(array $elementMap = null) + public function parseInnerTree(?array $elementMap = null) { $text = null; $elements = []; diff --git a/snappymail/v/0.0.0/app/libraries/Sabre/Xml/Service.php b/snappymail/v/0.0.0/app/libraries/Sabre/Xml/Service.php index cb9a5175b..ad18b6f4e 100644 --- a/snappymail/v/0.0.0/app/libraries/Sabre/Xml/Service.php +++ b/snappymail/v/0.0.0/app/libraries/Sabre/Xml/Service.php @@ -107,7 +107,7 @@ class Service * * @throws ParseException */ - public function parse($input, string $contextUri = null, string &$rootElementName = null) + public function parse($input, ?string $contextUri = null, ?string &$rootElementName = null) { if (is_resource($input)) { // Unfortunately the XMLReader doesn't support streams. When it @@ -151,7 +151,7 @@ class Service * * @throws ParseException */ - public function expect($rootElementName, $input, string $contextUri = null) + public function expect($rootElementName, $input, ?string $contextUri = null) { if (is_resource($input)) { // Unfortunately the XMLReader doesn't support streams. When it @@ -200,7 +200,7 @@ class Service * * @param string|array|object|XmlSerializable $value */ - public function write(string $rootElementName, $value, string $contextUri = null): string + public function write(string $rootElementName, $value, ?string $contextUri = null): string { $w = $this->getWriter(); $w->openMemory(); @@ -241,7 +241,6 @@ class Service public function mapValueObject(string $elementName, string $className): void { list($namespace) = self::parseClarkNotation($elementName); - $namespace = $namespace ?? ''; require_once __DIR__ . '/Deserializer/functions.php'; $this->elementMap[$elementName] = function (Reader $reader) use ($className, $namespace) { @@ -265,7 +264,7 @@ class Service * * @throws \InvalidArgumentException */ - public function writeValueObject(object $object, string $contextUri = null): string + public function writeValueObject(object $object, ?string $contextUri = null): string { if (!isset($this->valueObjectMap[get_class($object)])) { throw new \InvalidArgumentException('"'.get_class($object).'" is not a registered value object class. Register your class with mapValueObject.'); @@ -284,7 +283,7 @@ class Service * * If the string was invalid, it will throw an InvalidArgumentException. * - * @return array{string|null, string} + * @return array{string, string} * * @throws \InvalidArgumentException */ diff --git a/snappymail/v/0.0.0/app/libraries/Sabre/Xml/Version.php b/snappymail/v/0.0.0/app/libraries/Sabre/Xml/Version.php index 1b3b4f9b3..f38e87c27 100644 --- a/snappymail/v/0.0.0/app/libraries/Sabre/Xml/Version.php +++ b/snappymail/v/0.0.0/app/libraries/Sabre/Xml/Version.php @@ -16,5 +16,5 @@ class Version /** * Full version number. */ - public const VERSION = '4.0.4'; + public const VERSION = '4.0.5'; } diff --git a/snappymail/v/0.0.0/app/libraries/Sabre/Xml/Writer.php b/snappymail/v/0.0.0/app/libraries/Sabre/Xml/Writer.php index e7d7eb941..77bdae02c 100644 --- a/snappymail/v/0.0.0/app/libraries/Sabre/Xml/Writer.php +++ b/snappymail/v/0.0.0/app/libraries/Sabre/Xml/Writer.php @@ -125,7 +125,6 @@ class Writer extends \XMLWriter if ('{' === $name[0]) { list($namespace, $localName) = Service::parseClarkNotation($name); - $namespace = $namespace ?? ''; if (array_key_exists($namespace, $this->namespaceMap)) { $result = $this->startElementNS( @@ -240,7 +239,6 @@ class Writer extends \XMLWriter $localName ) = Service::parseClarkNotation($name); - $namespace = $namespace ?? ''; if (array_key_exists($namespace, $this->namespaceMap)) { // It's an attribute with a namespace we know return $this->writeAttribute(