Commit 2d03019c authored by Tony Zelenoff's avatar Tony Zelenoff
Browse files

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: default avatarTony Zelenoff <>
parent cc717c27
......@@ -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);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment