diff options
author | Tony Zelenoff <antonz@parallels.com> | 2014-10-09 17:15:12 +0400 |
---|---|---|
committer | Tony Zelenoff <antonz@parallels.com> | 2014-10-09 17:15:12 +0400 |
commit | 2d03019c91ab8d07dfbfb1e54db86d0c4978ab9a (patch) | |
tree | a4a948a9c3221a542725b18b021a03690d605429 /lib/private/largefilehelper.php | |
parent | cc717c27d6cbfadfff4dc6cdfe110baccd097c84 (diff) | |
download | nextcloud-server-2d03019c91ab8d07dfbfb1e54db86d0c4978ab9a.tar.gz nextcloud-server-2d03019c91ab8d07dfbfb1e54db86d0c4978ab9a.zip |
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@parallels.com>
Diffstat (limited to 'lib/private/largefilehelper.php')
-rw-r--r-- | lib/private/largefilehelper.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/private/largefilehelper.php b/lib/private/largefilehelper.php index 2c35feefc8b..d5b7946feff 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); |