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
|
@ -101,7 +101,7 @@ class LargeFileHelper {
|
||||||
*/
|
*/
|
||||||
public function getFileSizeViaCurl($filename) {
|
public function getFileSizeViaCurl($filename) {
|
||||||
if (function_exists('curl_init')) {
|
if (function_exists('curl_init')) {
|
||||||
$fencoded = urlencode($filename);
|
$fencoded = rawurlencode($filename);
|
||||||
$ch = curl_init("file://$fencoded");
|
$ch = curl_init("file://$fencoded");
|
||||||
curl_setopt($ch, CURLOPT_NOBODY, true);
|
curl_setopt($ch, CURLOPT_NOBODY, true);
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
|
|
@ -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() {
|
public function setUp() {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$ds = DIRECTORY_SEPARATOR;
|
$ds = DIRECTORY_SEPARATOR;
|
||||||
$this->filename = dirname(__DIR__) . "{$ds}data{$ds}data.tar.gz";
|
$this->filename = dirname(__DIR__) . "{$ds}data{$ds}strängé filename (duplicate #2).txt";
|
||||||
$this->fileSize = 4195;
|
$this->fileSize = 446;
|
||||||
$this->helper = new \OC\LargeFileHelper;
|
$this->helper = new \OC\LargeFileHelper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue