[Pkg-owncloud-commits] [owncloud] 241/258: Urlencode file name before passing it to cURL
David Prévot
taffit at moszumanska.debian.org
Sat Oct 11 17:22:40 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 34c1760e9f62dbe780aa6eca68d4fa7da475c7b5
Author: Tony Zelenoff <antonz at parallels.com>
Date: Thu Oct 9 17:15:12 2014 +0400
Urlencode file name before passing it to cURL
Large file helper use cURL to determine file sizes. Thus filenames must be
urlencoded in case special symbols like '#' can cause BadRequest errors.
Signed-off-by: Tony Zelenoff <antonz at parallels.com>
Backport of 2d03019c91ab8d07dfbfb1e54db86d0c4978ab9a from master
---
lib/private/largefilehelper.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/private/largefilehelper.php b/lib/private/largefilehelper.php
index 293e09f..a247996 100644
--- a/lib/private/largefilehelper.php
+++ b/lib/private/largefilehelper.php
@@ -101,7 +101,8 @@ class LargeFileHelper {
*/
public function getFileSizeViaCurl($filename) {
if (function_exists('curl_init')) {
- $ch = curl_init("file://$filename");
+ $fencoded = urlencode($filename);
+ $ch = curl_init("file://$fencoded");
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
--
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