diff options
author | Hendrik Langer <hendrik.langer@gmx.de> | 2011-10-19 23:38:35 +0200 |
---|---|---|
committer | Hendrik Langer <hendrik.langer@gmx.de> | 2011-10-19 23:38:35 +0200 |
commit | 466b41c36bf7093cdde9d2856eb520503f52640c (patch) | |
tree | 6456918f3f142f0ade1370ffb948fa9ffc59a267 /lib/remote | |
parent | da8d32ae38acdab576a30ca56b30579f427c780d (diff) | |
download | nextcloud-server-466b41c36bf7093cdde9d2856eb520503f52640c.tar.gz nextcloud-server-466b41c36bf7093cdde9d2856eb520503f52640c.zip |
Don't use sys_get_temp_dir(), as it reports the wrong path in restricted environments
Diffstat (limited to 'lib/remote')
-rw-r--r-- | lib/remote/cloud.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/remote/cloud.php b/lib/remote/cloud.php index 75d60155d06..a9c74e8bf5f 100644 --- a/lib/remote/cloud.php +++ b/lib/remote/cloud.php @@ -17,7 +17,7 @@ class OC_REMOTE_CLOUD{ */ private function apiCall($action,$parameters=false,$assoc=false){ if(!$this->cookiefile){ - $this->cookiefile=sys_get_temp_dir().'/remoteCloudCookie'.uniqid(); + $this->cookiefile=get_temp_dir().'/remoteCloudCookie'.uniqid(); } $url=$this->path.='/files/api.php'; $fields_string="action=$action&"; @@ -168,9 +168,9 @@ class OC_REMOTE_CLOUD{ } $ch=curl_init(); if(!$this->cookiefile){ - $this->cookiefile=sys_get_temp_dir().'/remoteCloudCookie'.uniqid(); + $this->cookiefile=get_temp_dir().'/remoteCloudCookie'.uniqid(); } - $tmpfile=tempnam(sys_get_temp_dir(),'remoteCloudFile'); + $tmpfile=tempnam(get_temp_dir(),'remoteCloudFile'); $fp=fopen($tmpfile,'w+'); $url=$this->path.="/files/api.php?action=get&dir=$dir&file=$file"; curl_setopt($ch,CURLOPT_URL,$url); @@ -191,7 +191,7 @@ class OC_REMOTE_CLOUD{ public function sendTmpFile($tmp,$targetDir,$targetFile){ $token=sha1(uniqid().$tmp); - $file=sys_get_temp_dir().'/'.'remoteCloudFile'.$token; + $file=get_temp_dir().'/'.'remoteCloudFile'.$token; rename($tmp,$file); if( OC_Config::getValue( "forcessl", false ) or isset($_SERVER['HTTPS']) and $_SERVER['HTTPS'] == 'on') { $url = "https://". $_SERVER['SERVER_NAME'] . OC::$WEBROOT; |