diff --git a/composer.lock b/composer.lock index 52f8a0580..3080d4b8d 100644 --- a/composer.lock +++ b/composer.lock @@ -3438,16 +3438,16 @@ }, { "name": "sabre/dav", - "version": "4.5.0", + "version": "4.6.0", "source": { "type": "git", "url": "https://github.com/sabre-io/dav.git", - "reference": "7e40343e473f17eab3d1d6ca4ae3e1cdfc6e0fd8" + "reference": "554145304b4a026477d130928d16e626939b0b2a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sabre-io/dav/zipball/7e40343e473f17eab3d1d6ca4ae3e1cdfc6e0fd8", - "reference": "7e40343e473f17eab3d1d6ca4ae3e1cdfc6e0fd8", + "url": "https://api.github.com/repos/sabre-io/dav/zipball/554145304b4a026477d130928d16e626939b0b2a", + "reference": "554145304b4a026477d130928d16e626939b0b2a", "shasum": "" }, "require": { @@ -3471,7 +3471,7 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "^2.19", - "monolog/monolog": "^1.27", + "monolog/monolog": "^1.27 || ^2.0", "phpstan/phpstan": "^0.12 || ^1.0", "phpstan/phpstan-phpunit": "^1.0", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6" @@ -3517,7 +3517,7 @@ "issues": "https://github.com/sabre-io/dav/issues", "source": "https://github.com/fruux/sabre-dav" }, - "time": "2023-11-14T10:48:05+00:00" + "time": "2023-12-11T13:01:23+00:00" }, { "name": "sabre/event", @@ -3814,16 +3814,16 @@ }, { "name": "sabre/xml", - "version": "2.2.6", + "version": "2.2.7", "source": { "type": "git", "url": "https://github.com/sabre-io/xml.git", - "reference": "9cde7cdab1e50893cc83b037b40cd47bfde42a2b" + "reference": "f1d53d55976bbd4cf3e640dda6ebc31120c71a4e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sabre-io/xml/zipball/9cde7cdab1e50893cc83b037b40cd47bfde42a2b", - "reference": "9cde7cdab1e50893cc83b037b40cd47bfde42a2b", + "url": "https://api.github.com/repos/sabre-io/xml/zipball/f1d53d55976bbd4cf3e640dda6ebc31120c71a4e", + "reference": "f1d53d55976bbd4cf3e640dda6ebc31120c71a4e", "shasum": "" }, "require": { @@ -3879,7 +3879,7 @@ "issues": "https://github.com/sabre-io/xml/issues", "source": "https://github.com/fruux/sabre-xml" }, - "time": "2023-06-28T12:56:05+00:00" + "time": "2024-04-18T10:15:43+00:00" }, { "name": "scssphp/scssphp", diff --git a/composer/installed.json b/composer/installed.json index 2a6c28d33..3bab863dc 100644 --- a/composer/installed.json +++ b/composer/installed.json @@ -3591,17 +3591,17 @@ }, { "name": "sabre/dav", - "version": "4.5.0", - "version_normalized": "4.5.0.0", + "version": "4.6.0", + "version_normalized": "4.6.0.0", "source": { "type": "git", "url": "https://github.com/sabre-io/dav.git", - "reference": "7e40343e473f17eab3d1d6ca4ae3e1cdfc6e0fd8" + "reference": "554145304b4a026477d130928d16e626939b0b2a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sabre-io/dav/zipball/7e40343e473f17eab3d1d6ca4ae3e1cdfc6e0fd8", - "reference": "7e40343e473f17eab3d1d6ca4ae3e1cdfc6e0fd8", + "url": "https://api.github.com/repos/sabre-io/dav/zipball/554145304b4a026477d130928d16e626939b0b2a", + "reference": "554145304b4a026477d130928d16e626939b0b2a", "shasum": "" }, "require": { @@ -3625,7 +3625,7 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "^2.19", - "monolog/monolog": "^1.27", + "monolog/monolog": "^1.27 || ^2.0", "phpstan/phpstan": "^0.12 || ^1.0", "phpstan/phpstan-phpunit": "^1.0", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6" @@ -3635,7 +3635,7 @@ "ext-imap": "*", "ext-pdo": "*" }, - "time": "2023-11-14T10:48:05+00:00", + "time": "2023-12-11T13:01:23+00:00", "bin": [ "bin/sabredav", "bin/naturalselection" @@ -3987,17 +3987,17 @@ }, { "name": "sabre/xml", - "version": "2.2.6", - "version_normalized": "2.2.6.0", + "version": "2.2.7", + "version_normalized": "2.2.7.0", "source": { "type": "git", "url": "https://github.com/sabre-io/xml.git", - "reference": "9cde7cdab1e50893cc83b037b40cd47bfde42a2b" + "reference": "f1d53d55976bbd4cf3e640dda6ebc31120c71a4e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sabre-io/xml/zipball/9cde7cdab1e50893cc83b037b40cd47bfde42a2b", - "reference": "9cde7cdab1e50893cc83b037b40cd47bfde42a2b", + "url": "https://api.github.com/repos/sabre-io/xml/zipball/f1d53d55976bbd4cf3e640dda6ebc31120c71a4e", + "reference": "f1d53d55976bbd4cf3e640dda6ebc31120c71a4e", "shasum": "" }, "require": { @@ -4013,7 +4013,7 @@ "phpstan/phpstan": "^0.12", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.0" }, - "time": "2023-06-28T12:56:05+00:00", + "time": "2024-04-18T10:15:43+00:00", "type": "library", "installation-source": "dist", "autoload": { diff --git a/composer/installed.php b/composer/installed.php index 396ecaf21..c8fce3406 100644 --- a/composer/installed.php +++ b/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'nextcloud/3rdparty', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'e6472c57e8ce0baae2ffd975a2dbe39acf3c0a41', + 'reference' => '0ecec0a5d936442e91288c31eaef178b092fe09a', 'type' => 'library', 'install_path' => __DIR__ . '/../', 'aliases' => array(), @@ -292,7 +292,7 @@ 'nextcloud/3rdparty' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'e6472c57e8ce0baae2ffd975a2dbe39acf3c0a41', + 'reference' => '0ecec0a5d936442e91288c31eaef178b092fe09a', 'type' => 'library', 'install_path' => __DIR__ . '/../', 'aliases' => array(), @@ -563,9 +563,9 @@ ), ), 'sabre/dav' => array( - 'pretty_version' => '4.5.0', - 'version' => '4.5.0.0', - 'reference' => '7e40343e473f17eab3d1d6ca4ae3e1cdfc6e0fd8', + 'pretty_version' => '4.6.0', + 'version' => '4.6.0.0', + 'reference' => '554145304b4a026477d130928d16e626939b0b2a', 'type' => 'library', 'install_path' => __DIR__ . '/../sabre/dav', 'aliases' => array(), @@ -608,9 +608,9 @@ 'dev_requirement' => false, ), 'sabre/xml' => array( - 'pretty_version' => '2.2.6', - 'version' => '2.2.6.0', - 'reference' => '9cde7cdab1e50893cc83b037b40cd47bfde42a2b', + 'pretty_version' => '2.2.7', + 'version' => '2.2.7.0', + 'reference' => 'f1d53d55976bbd4cf3e640dda6ebc31120c71a4e', 'type' => 'library', 'install_path' => __DIR__ . '/../sabre/xml', 'aliases' => array(), diff --git a/sabre/dav/lib/DAV/Client.php b/sabre/dav/lib/DAV/Client.php index a9de71cdb..1028a6b9d 100644 --- a/sabre/dav/lib/DAV/Client.php +++ b/sabre/dav/lib/DAV/Client.php @@ -174,27 +174,98 @@ public function __construct(array $settings) } /** - * Does a PROPFIND request. + * Does a PROPFIND request with filtered response returning only available properties. * * The list of requested properties must be specified as an array, in clark * notation. * - * The returned array will contain a list of filenames as keys, and - * properties as values. + * Depth should be either 0 or 1. A depth of 1 will cause a request to be + * made to the server to also return all child resources. + * + * For depth 0, just the array of properties for the resource is returned. + * + * For depth 1, the returned array will contain a list of resource names as keys, + * and an array of properties as values. * - * The properties array will contain the list of properties. Only properties - * that are actually returned from the server (without error) will be + * The array of properties will contain the properties as keys with their values as the value. + * Only properties that are actually returned from the server without error will be * returned, anything else is discarded. * + * @param 1|0 $depth + */ + public function propFind($url, array $properties, $depth = 0): array + { + $result = $this->doPropFind($url, $properties, $depth); + + // If depth was 0, we only return the top item + if (0 === $depth) { + reset($result); + $result = current($result); + + return isset($result[200]) ? $result[200] : []; + } + + $newResult = []; + foreach ($result as $href => $statusList) { + $newResult[$href] = isset($statusList[200]) ? $statusList[200] : []; + } + + return $newResult; + } + + /** + * Does a PROPFIND request with unfiltered response. + * + * The list of requested properties must be specified as an array, in clark + * notation. + * * Depth should be either 0 or 1. A depth of 1 will cause a request to be * made to the server to also return all child resources. * - * @param string $url - * @param int $depth + * For depth 0, just the multi-level array of status and properties for the resource is returned. * - * @return array + * For depth 1, the returned array will contain a list of resources as keys and + * a multi-level array containing status and properties as value. + * + * The multi-level array of status and properties is formatted the same as what is + * documented for parseMultiStatus. + * + * All properties that are actually returned from the server are returned by this method. + * + * @param 1|0 $depth + */ + public function propFindUnfiltered(string $url, array $properties, int $depth = 0): array + { + $result = $this->doPropFind($url, $properties, $depth); + + // If depth was 0, we only return the top item + if (0 === $depth) { + reset($result); + + return current($result); + } else { + return $result; + } + } + + /** + * Does a PROPFIND request. + * + * The list of requested properties must be specified as an array, in clark + * notation. + * + * Depth should be either 0 or 1. A depth of 1 will cause a request to be + * made to the server to also return all child resources. + * + * The returned array will contain a list of resources as keys and + * a multi-level array containing status and properties as value. + * + * The multi-level array of status and properties is formatted the same as what is + * documented for parseMultiStatus. + * + * @param 1|0 $depth */ - public function propFind($url, array $properties, $depth = 0) + private function doPropFind($url, array $properties, $depth = 0): array { $dom = new \DOMDocument('1.0', 'UTF-8'); $dom->formatOutput = true; @@ -232,22 +303,7 @@ public function propFind($url, array $properties, $depth = 0) throw new HTTP\ClientHttpException($response); } - $result = $this->parseMultiStatus($response->getBodyAsString()); - - // If depth was 0, we only return the top item - if (0 === $depth) { - reset($result); - $result = current($result); - - return isset($result[200]) ? $result[200] : []; - } - - $newResult = []; - foreach ($result as $href => $statusList) { - $newResult[$href] = isset($statusList[200]) ? $statusList[200] : []; - } - - return $newResult; + return $this->parseMultiStatus($response->getBodyAsString()); } /** @@ -385,7 +441,7 @@ public function getAbsoluteUrl($url) { return Uri\resolve( $this->baseUri, - $url + (string) $url ); } diff --git a/sabre/dav/lib/DAV/Version.php b/sabre/dav/lib/DAV/Version.php index 97566524f..345c62d7e 100644 --- a/sabre/dav/lib/DAV/Version.php +++ b/sabre/dav/lib/DAV/Version.php @@ -16,5 +16,5 @@ class Version /** * Full version number. */ - public const VERSION = '4.5.0'; + public const VERSION = '4.6.0'; } diff --git a/sabre/dav/lib/DAV/Xml/Property/Href.php b/sabre/dav/lib/DAV/Xml/Property/Href.php index f88ce814a..d4e43da7c 100644 --- a/sabre/dav/lib/DAV/Xml/Property/Href.php +++ b/sabre/dav/lib/DAV/Xml/Property/Href.php @@ -34,6 +34,19 @@ class Href implements Element, HtmlOutput */ protected $hrefs; + /** + * Automatically prefix the url with the server base directory. + * Note: use of this property in code was removed in PR: + * https://github.com/sabre-io/dav/pull/801 + * But the property is left here because old data may still exist + * that has this property saved. + * See discussion in issue: + * https://github.com/sabre-io/Baikal/issues/1154. + * + * @var bool + */ + protected $autoPrefix = true; + /** * Constructor. * diff --git a/sabre/xml/lib/Deserializer/functions.php b/sabre/xml/lib/Deserializer/functions.php index 62d4d0e07..7a16ec9e0 100644 --- a/sabre/xml/lib/Deserializer/functions.php +++ b/sabre/xml/lib/Deserializer/functions.php @@ -215,6 +215,9 @@ function valueObject(Reader $reader, string $className, string $namespace) // 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/sabre/xml/lib/Version.php b/sabre/xml/lib/Version.php index 6b6c53b18..860beaa7c 100644 --- a/sabre/xml/lib/Version.php +++ b/sabre/xml/lib/Version.php @@ -16,5 +16,5 @@ class Version /** * Full version number. */ - const VERSION = '2.2.6'; + const VERSION = '2.2.7'; }