Merge pull request #11501 from Ansud/master

Urlencode file name before passing it to cURL
This commit is contained in:
Vincent Petry 2014-10-10 10:57:59 +02:00
commit 660e9c4012
1 changed files with 2 additions and 1 deletions

View File

@ -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);