aboutsummaryrefslogtreecommitdiffstats
path: root/lib/filesystem.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2012-01-03 15:55:38 +0100
committerRobin Appelman <icewind1991@gmail.com>2012-01-03 15:55:38 +0100
commit9e9bc1430b6b31be67a346421c1989c2d44fad11 (patch)
treec7ba1f6c38523c4900c6f355833a88ab86716546 /lib/filesystem.php
parent4c8f17ad4747592cc01525c663de32962552cf18 (diff)
downloadnextcloud-server-9e9bc1430b6b31be67a346421c1989c2d44fad11.tar.gz
nextcloud-server-9e9bc1430b6b31be67a346421c1989c2d44fad11.zip
don't check if the target path is writable for operations that can create a new file
fixes file upload
Diffstat (limited to 'lib/filesystem.php')
-rw-r--r--lib/filesystem.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/filesystem.php b/lib/filesystem.php
index 627f494c937..44401260c5e 100644
--- a/lib/filesystem.php
+++ b/lib/filesystem.php
@@ -283,7 +283,7 @@ class OC_Filesystem{
return self::basicOperation('unlink',$path,array('delete'));
}
static public function rename($path1,$path2){
- if(OC_FileProxy::runPreProxies('rename',$path1,$path2) and self::is_writeable($path1) and self::is_writeable($path2)){
+ if(OC_FileProxy::runPreProxies('rename',$path1,$path2) and self::is_writeable($path1) and self::isValidPath($path2)){
$run=true;
OC_Hook::emit( 'OC_Filesystem', 'rename', array( 'oldpath' => $path1 ,'newpath'=>$path2, 'run' => &$run));
if($run){
@@ -304,7 +304,7 @@ class OC_Filesystem{
}
}
static public function copy($path1,$path2){
- if(OC_FileProxy::runPreProxies('copy',$path1,$path2) and self::is_readable($path1) and self::is_writeable($path2)){
+ if(OC_FileProxy::runPreProxies('copy',$path1,$path2) and self::is_readable($path1) and self::isValidPath($path2)){
$run=true;
OC_Hook::emit( 'OC_Filesystem', 'copy', array( 'oldpath' => $path1 ,'newpath'=>$path2, 'run' => &$run));
$exists=self::file_exists($path2);
@@ -365,7 +365,7 @@ class OC_Filesystem{
}
}
static public function fromTmpFile($tmpFile,$path){
- if(OC_FileProxy::runPreProxies('copy',$tmpFile,$path) and self::is_writeable($path) and $storage=self::getStorage($path)){
+ if(OC_FileProxy::runPreProxies('copy',$tmpFile,$path) and self::isValidPath($path) and $storage=self::getStorage($path)){
$run=true;
$exists=self::file_exists($path);
if(!$exists){
@@ -385,7 +385,7 @@ class OC_Filesystem{
}
}
static public function fromUploadedFile($tmpFile,$path){
- if(OC_FileProxy::runPreProxies('fromUploadedFile',$tmpFile,$path) and self::is_writeable($path) and $storage=self::getStorage($path)){
+ if(OC_FileProxy::runPreProxies('fromUploadedFile',$tmpFile,$path) and self::isValidPath($path) and $storage=self::getStorage($path)){
$run=true;
$exists=self::file_exists($path);
if(!$exists){