aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files
diff options
context:
space:
mode:
authorKate <26026535+provokateurin@users.noreply.github.com>2024-09-09 11:04:08 +0200
committerGitHub <noreply@github.com>2024-09-09 11:04:08 +0200
commit0f732199d22cf85d991f48389c33fb6e76b7eefc (patch)
tree09a7668f1b1ebad18dd65e002b7c2a9174cbbab9 /lib/private/Files
parent1fa674d907e211e1fac12e407e844b2a24f0bc0e (diff)
parent70fa51f042014cfaf80d489a838eafc4b08192b3 (diff)
downloadnextcloud-server-0f732199d22cf85d991f48389c33fb6e76b7eefc.tar.gz
nextcloud-server-0f732199d22cf85d991f48389c33fb6e76b7eefc.zip
Merge pull request #47837 from nextcloud/fix/files/dav-etag
Diffstat (limited to 'lib/private/Files')
-rw-r--r--lib/private/Files/Storage/Common.php2
-rw-r--r--lib/private/Files/Storage/DAV.php3
-rw-r--r--lib/private/Files/Storage/Local.php8
3 files changed, 3 insertions, 10 deletions
diff --git a/lib/private/Files/Storage/Common.php b/lib/private/Files/Storage/Common.php
index 9541ba7c746..cefba66683b 100644
--- a/lib/private/Files/Storage/Common.php
+++ b/lib/private/Files/Storage/Common.php
@@ -391,7 +391,7 @@ abstract class Common implements Storage, ILockingStorage, IWriteStreamStorage {
* get the ETag for a file or folder
*
* @param string $path
- * @return string
+ * @return string|false
*/
public function getETag($path) {
return uniqid();
diff --git a/lib/private/Files/Storage/DAV.php b/lib/private/Files/Storage/DAV.php
index ac9b7a72855..4c017082cea 100644
--- a/lib/private/Files/Storage/DAV.php
+++ b/lib/private/Files/Storage/DAV.php
@@ -721,10 +721,9 @@ class DAV extends Common {
return $stat ? $stat['permissions'] : 0;
}
- /** {@inheritdoc} */
public function getETag($path) {
$meta = $this->getMetaData($path);
- return $meta ? $meta['etag'] : null;
+ return $meta ? $meta['etag'] : false;
}
/**
diff --git a/lib/private/Files/Storage/Local.php b/lib/private/Files/Storage/Local.php
index a65d60bf278..bb07ce3ab29 100644
--- a/lib/private/Files/Storage/Local.php
+++ b/lib/private/Files/Storage/Local.php
@@ -513,17 +513,11 @@ class Local extends \OC\Files\Storage\Common {
return true;
}
- /**
- * get the ETag for a file or folder
- *
- * @param string $path
- * @return string
- */
public function getETag($path) {
return $this->calculateEtag($path, $this->stat($path));
}
- private function calculateEtag(string $path, array $stat): string {
+ private function calculateEtag(string $path, array $stat): string|false {
if ($stat['mode'] & 0x4000 && !($stat['mode'] & 0x8000)) { // is_dir & not socket
return parent::getETag($path);
} else {