diff --git a/changelog/unreleased/36319 b/changelog/unreleased/36319 new file mode 100644 index 000000000000..1238f4086c59 --- /dev/null +++ b/changelog/unreleased/36319 @@ -0,0 +1,5 @@ +Bugfix: LargeFileHelper::getFileSizeViaCurl is broken with newer libcurl + +getFileSizeViaCurl is a workaround for 32 bit platforms. Path separator was encoded when encoding the path but newer libcurl doesn't support that. + +https://github.com/owncloud/core/pull/36319 diff --git a/lib/private/LargeFileHelper.php b/lib/private/LargeFileHelper.php index 3e4c0e042f13..c35c0db8ade7 100644 --- a/lib/private/LargeFileHelper.php +++ b/lib/private/LargeFileHelper.php @@ -114,7 +114,9 @@ public function getFileSize($filename) { */ public function getFileSizeViaCurl($fileName) { if (\OC::$server->getIniWrapper()->getString('open_basedir') === '') { - $encodedFileName = \rawurlencode($fileName); + $pathParts = \explode('/', $fileName); + $encodedPathParts = \array_map('rawurlencode', $pathParts); + $encodedFileName = \implode('/', $encodedPathParts); $ch = \curl_init("file://$encodedFileName"); \curl_setopt($ch, CURLOPT_NOBODY, true); \curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);