Skip to content

Commit

Permalink
Do not encode path separator
Browse files Browse the repository at this point in the history
  • Loading branch information
VicDeo committed Oct 23, 2019
1 parent 822f3e6 commit e6a5c9f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions changelog/unreleased/36319
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion lib/private/LargeFileHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e6a5c9f

Please sign in to comment.