Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): Bump sabre/dav from 4.5.0 to 4.6.0 #1708

Merged
merged 2 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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": {
Expand All @@ -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": {
Expand Down
16 changes: 8 additions & 8 deletions composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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(),
Expand Down
108 changes: 82 additions & 26 deletions sabre/dav/lib/DAV/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
}

/**
Expand Down Expand Up @@ -385,7 +441,7 @@ public function getAbsoluteUrl($url)
{
return Uri\resolve(
$this->baseUri,
$url
(string) $url
);
}

Expand Down
2 changes: 1 addition & 1 deletion sabre/dav/lib/DAV/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ class Version
/**
* Full version number.
*/
public const VERSION = '4.5.0';
public const VERSION = '4.6.0';
}
13 changes: 13 additions & 0 deletions sabre/dav/lib/DAV/Xml/Property/Href.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
3 changes: 3 additions & 0 deletions sabre/xml/lib/Deserializer/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion sabre/xml/lib/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ class Version
/**
* Full version number.
*/
const VERSION = '2.2.6';
const VERSION = '2.2.7';
}
Loading