Skip to content

Commit 4e8e121

Browse files
committed
fixup! fix(dav): allow uploading of files with long filenames
1 parent 650a4a5 commit 4e8e121

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

apps/dav/lib/Connector/Sabre/File.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -382,14 +382,9 @@ private function getPartFileBasePath($path) {
382382
$filename = basename($path);
383383
// length in bytes NOT characters
384384
$filenameLength = strlen($filename);
385-
// check if filename (with transfer id and part extension) overflows the filesystem limit of 255 BYTES
386-
// 255 - strlen('.ocTransferId') - strlen('.part') - strlen((string)getrandmax())
387-
if ($filenameLength >= 225) {
388-
// hash does not need to be secure but fast and semi unique
389-
$filename = hash('xxh128', $filename);
390-
return substr($path, 0, strlen($path) - $filenameLength) . $filename;
391-
}
392-
return $path;
385+
// hash does not need to be secure but fast and semi unique
386+
$filename = hash('xxh128', $filename);
387+
return substr($path, 0, strlen($path) - $filenameLength) . $filename;
393388
} else {
394389
// will place the .part file in the users root directory
395390
// therefor we need to make the name (semi) unique - hash does not need to be secure but fast.

0 commit comments

Comments
 (0)