From 466b41c36bf7093cdde9d2856eb520503f52640c Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Wed, 19 Oct 2011 23:38:35 +0200 Subject: Don't use sys_get_temp_dir(), as it reports the wrong path in restricted environments --- lib/filestorage/local.php | 2 +- lib/filestorage/remote.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/filestorage') diff --git a/lib/filestorage/local.php b/lib/filestorage/local.php index 8e0907f8d3b..8db0ffead4e 100644 --- a/lib/filestorage/local.php +++ b/lib/filestorage/local.php @@ -161,7 +161,7 @@ class OC_Filestorage_Local extends OC_Filestorage{ } public function toTmpFile($path){ - $tmpFolder=sys_get_temp_dir(); + $tmpFolder=get_temp_dir(); $filename=tempnam($tmpFolder,'OC_TEMP_FILE_'.substr($path,strrpos($path,'.'))); $fileStats = stat($this->datadir.$path); if(copy($this->datadir.$path,$filename)){ diff --git a/lib/filestorage/remote.php b/lib/filestorage/remote.php index fb14c4121a2..88bdbca481c 100644 --- a/lib/filestorage/remote.php +++ b/lib/filestorage/remote.php @@ -211,7 +211,7 @@ class OC_Filestorage_Remote extends OC_Filestorage{ $parent=dirname($path); $name=substr($path,strlen($parent)+1); $file=$this->remote->getFile($parent,$name); - $file=tempnam(sys_get_temp_dir(),'oc_'); + $file=tempnam(get_temp_dir(),'oc_'); file_put_contents($file,$data); if($return=$this->remote->sendTmpFile($file,$parent,$name)){ $this->notifyObservers($path,OC_FILEACTION_WRITE); -- cgit v1.2.3