[Pkg-owncloud-commits] [owncloud] 26/34: Use `rawurlencode` since this seems to be expected by cURL

David Prévot taffit at moszumanska.debian.org
Fri Oct 17 01:32:17 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 508ef234867aff3de0e74a8f27cf042d55f9e705
Author: Lukas Reschke <lukas at owncloud.com>
Date:   Sun Oct 12 18:40:10 2014 +0200

    Use `rawurlencode` since this seems to be expected by cURL
    
    Fixes https://github.com/owncloud/core/pull/11501#issuecomment-58794405
    
    Conflicts:
    	tests/lib/largefilehelpergetfilesize.php
---
 lib/private/largefilehelper.php                                | 2 +-
 "tests/data/str\303\244ng\303\251 filename (duplicate #2).txt" | 4 ++++
 tests/lib/largefilehelpergetfilesize.php                       | 5 +++--
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/lib/private/largefilehelper.php b/lib/private/largefilehelper.php
index a247996..87a08e8 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\303\244ng\303\251 filename (duplicate #2).txt" "b/tests/data/str\303\244ng\303\251 filename (duplicate #2).txt"
new file mode 100644
index 0000000..b62c3fb
--- /dev/null
+++ "b/tests/data/str\303\244ng\303\251 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 86ce6d2..58571d6 100644
--- a/tests/lib/largefilehelpergetfilesize.php
+++ b/tests/lib/largefilehelpergetfilesize.php
@@ -19,8 +19,9 @@ class LargeFileHelperGetFileSize extends \PHPUnit_Framework_TestCase {
 
 	public function setUp() {
 		parent::setUp();
-		$this->filename = __DIR__ . '/../data/data.tar.gz';
-		$this->fileSize = 4195;
+		$ds = DIRECTORY_SEPARATOR;
+		$this->filename = dirname(__DIR__) . "{$ds}data{$ds}strängé filename (duplicate #2).txt";
+		$this->fileSize = 446;
 		$this->helper = new \OC\LargeFileHelper;
 	}
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list