]> source.dussan.org Git - nextcloud-server.git/commitdiff
replace ' ' with '%20' in urls for curl
authorJörn Friedrich Dreyer <jfd@butonic.de>
Mon, 19 Aug 2013 09:09:55 +0000 (11:09 +0200)
committerJörn Friedrich Dreyer <jfd@butonic.de>
Mon, 19 Aug 2013 09:09:55 +0000 (11:09 +0200)
apps/files_external/lib/webdav.php

index f98be318f1ce61b380459cb1dbb70880bb396a5e..74a323af28614bba004672f38a54aad2e3cf4ada 100644 (file)
@@ -171,7 +171,7 @@ class DAV extends \OC\Files\Storage\Common{
                                $curl = curl_init();
                                $fp = fopen('php://temp', 'r+');
                                curl_setopt($curl, CURLOPT_USERPWD, $this->user.':'.$this->password);
-                               curl_setopt($curl, CURLOPT_URL, $this->createBaseUri().$path);
+                               curl_setopt($curl, CURLOPT_URL, $this->createBaseUri().str_replace(' ', '%20', $path));
                                curl_setopt($curl, CURLOPT_FILE, $fp);
                                curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
 
@@ -256,7 +256,7 @@ class DAV extends \OC\Files\Storage\Common{
 
                $curl = curl_init();
                curl_setopt($curl, CURLOPT_USERPWD, $this->user.':'.$this->password);
-               curl_setopt($curl, CURLOPT_URL, $this->createBaseUri().$target);
+               curl_setopt($curl, CURLOPT_URL, $this->createBaseUri().str_replace(' ', '%20', $target));
                curl_setopt($curl, CURLOPT_BINARYTRANSFER, true);
                curl_setopt($curl, CURLOPT_INFILE, $source); // file pointer
                curl_setopt($curl, CURLOPT_INFILESIZE, filesize($path));