mirror of
https://github.com/nextcloud/server.git
synced 2026-04-22 23:03:00 -04:00
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>
This commit is contained in:
parent
cc717c27d6
commit
2d03019c91
1 changed files with 2 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue