diff options
author | Lukas Reschke <lukas@owncloud.com> | 2014-10-15 19:58:27 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2014-10-15 19:58:27 +0200 |
commit | f82b996f5767d60f7d16968b2959f9d3d925d1fd (patch) | |
tree | 1d3762887a59cf588a8c98322cc69fcc16901a02 | |
parent | 7c40261ca9a3dc9e740541c680824ca0aaf10d77 (diff) | |
parent | 1b3feb710d59c39a044447159e7b06624b16dd6e (diff) | |
download | nextcloud-server-f82b996f5767d60f7d16968b2959f9d3d925d1fd.tar.gz nextcloud-server-f82b996f5767d60f7d16968b2959f9d3d925d1fd.zip |
Merge pull request #11528 from owncloud/use-raw-url
Use `rawurlencode` since this seems to be expected by cURL
-rw-r--r-- | lib/private/largefilehelper.php | 2 | ||||
-rw-r--r-- | tests/data/strängé filename (duplicate #2).txt | 4 | ||||
-rw-r--r-- | tests/lib/largefilehelpergetfilesize.php | 4 |
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; } |