summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-10-12 18:40:10 +0200
committerLukas Reschke <lukas@owncloud.com>2014-10-14 13:16:23 +0200
commit1b3feb710d59c39a044447159e7b06624b16dd6e (patch)
treeb9befdf7b5e01cec606814f77537af95af0f3460
parent766314a6be5a24a4bd7d503d9c44998c13fe348b (diff)
downloadnextcloud-server-1b3feb710d59c39a044447159e7b06624b16dd6e.tar.gz
nextcloud-server-1b3feb710d59c39a044447159e7b06624b16dd6e.zip
Use `rawurlencode` since this seems to be expected by cURL
Fixes https://github.com/owncloud/core/pull/11501#issuecomment-58794405
-rw-r--r--lib/private/largefilehelper.php2
-rw-r--r--tests/data/strängé filename (duplicate #2).txt4
-rw-r--r--tests/lib/largefilehelpergetfilesize.php4
3 files changed, 7 insertions, 3 deletions
diff --git a/lib/private/largefilehelper.php b/lib/private/largefilehelper.php
index d5b7946feff..33f32255f3b 100644
--- a/lib/private/largefilehelper.php
+++ b/lib/private/largefilehelper.php
@@ -101,7 +101,7 @@ class LargeFileHelper {
*/
public function getFileSizeViaCurl($filename) {
if (function_exists('curl_init')) {
- $fencoded = urlencode($filename);
+ $fencoded = rawurlencode($filename);
$ch = curl_init("file://$fencoded");
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
diff --git a/tests/data/strängé filename (duplicate #2).txt b/tests/data/strängé filename (duplicate #2).txt
new file mode 100644
index 00000000000..b62c3fb2ffd
--- /dev/null
+++ b/tests/data/strängé filename (duplicate #2).txt
@@ -0,0 +1,4 @@
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
+Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
+Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \ No newline at end of file
diff --git a/tests/lib/largefilehelpergetfilesize.php b/tests/lib/largefilehelpergetfilesize.php
index 21a0aa9a233..58571d641e0 100644
--- a/tests/lib/largefilehelpergetfilesize.php
+++ b/tests/lib/largefilehelpergetfilesize.php
@@ -20,8 +20,8 @@ class LargeFileHelperGetFileSize extends \PHPUnit_Framework_TestCase {
public function setUp() {
parent::setUp();
$ds = DIRECTORY_SEPARATOR;
- $this->filename = dirname(__DIR__) . "{$ds}data{$ds}data.tar.gz";
- $this->fileSize = 4195;
+ $this->filename = dirname(__DIR__) . "{$ds}data{$ds}strängé filename (duplicate #2).txt";
+ $this->fileSize = 446;
$this->helper = new \OC\LargeFileHelper;
}