Merge pull request #11528 from owncloud/use-raw-url
Use `rawurlencode` since this seems to be expected by cURL
This commit is contained in:
commit
f82b996f57
3 changed files with 7 additions and 3 deletions
|
@ -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);
|
||||
|
|
4
tests/data/strängé filename (duplicate #2).txt
Normal file
4
tests/data/strängé filename (duplicate #2).txt
Normal file
|
@ -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.
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue