summaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorCarlos Cerrillo <ccerrillo@gmail.com>2013-12-17 09:38:43 +0100
committerCarlos Cerrillo <ccerrillo@gmail.com>2013-12-17 09:38:43 +0100
commitb245e2e3d86299092448e3223b0d658d88206873 (patch)
tree0edd428e256568775ba13e1dfe67ff41afb3a205 /apps/files_external
parent7c264c88fe06c61ef602fa8a241428c99f220061 (diff)
downloadnextcloud-server-b245e2e3d86299092448e3223b0d658d88206873.tar.gz
nextcloud-server-b245e2e3d86299092448e3223b0d658d88206873.zip
Fixing tab/space coding style
Only set SSL things when ```$this->secure``` is ```true```
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/lib/webdav.php38
1 files changed, 21 insertions, 17 deletions
diff --git a/apps/files_external/lib/webdav.php b/apps/files_external/lib/webdav.php
index 2308c7873b8..9d56be8472a 100644
--- a/apps/files_external/lib/webdav.php
+++ b/apps/files_external/lib/webdav.php
@@ -65,15 +65,15 @@ class DAV extends \OC\Files\Storage\Common{
}
$this->ready = true;
- $settings = array(
- 'baseUri' => $this->createBaseUri(),
- 'userName' => $this->user,
- 'password' => $this->password,
- );
+ $settings = array(
+ 'baseUri' => $this->createBaseUri(),
+ 'userName' => $this->user,
+ 'password' => $this->password,
+ );
$this->client = new \Sabre_DAV_Client($settings);
- if ($this->certPath) {
+ if ($this->secure === true && $this->certPath) {
$this->client->addTrustedCertificates($this->certPath);
}
}
@@ -169,12 +169,14 @@ class DAV extends \OC\Files\Storage\Common{
curl_setopt($curl, CURLOPT_URL, $this->createBaseUri().str_replace(' ', '%20', $path));
curl_setopt($curl, CURLOPT_FILE, $fp);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
- curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
- curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
- if($this->certPath){
- curl_setopt($curl, CURLOPT_CAINFO, $this->certPath);
- }
-
+ if ($this->secure === true) {
+ curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
+ curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
+ if($this->certPath){
+ curl_setopt($curl, CURLOPT_CAINFO, $this->certPath);
+ }
+ }
+
curl_exec ($curl);
curl_close ($curl);
rewind($fp);
@@ -262,11 +264,13 @@ class DAV extends \OC\Files\Storage\Common{
curl_setopt($curl, CURLOPT_INFILE, $source); // file pointer
curl_setopt($curl, CURLOPT_INFILESIZE, filesize($path));
curl_setopt($curl, CURLOPT_PUT, true);
- curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
- curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
- if($this->certPath){
- curl_setopt($curl, CURLOPT_CAINFO, $this->certPath);
- }
+ if ($this->secure === true) {
+ curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
+ curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
+ if($this->certPath){
+ curl_setopt($curl, CURLOPT_CAINFO, $this->certPath);
+ }
+ }
curl_exec ($curl);
curl_close ($curl);
}