[Pkg-owncloud-commits] [owncloud] 09/49: check if a directory exists before we try to remove it
David Prévot
taffit at moszumanska.debian.org
Thu Dec 5 16:02:52 UTC 2013
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit 5ac3f9bfa5f3fd1a58d6a02b43e27a4105a03484
Author: Robin Appelman <icewind at owncloud.com>
Date: Mon Dec 2 22:43:58 2013 +0100
check if a directory exists before we try to remove it
---
lib/private/files/view.php | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index 8cb56ed..ac45a88 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -159,7 +159,11 @@ class View {
}
public function rmdir($path) {
- return $this->basicOperation('rmdir', $path, array('delete'));
+ if ($this->is_dir($path)) {
+ return $this->basicOperation('rmdir', $path, array('delete'));
+ } else {
+ return false;
+ }
}
public function opendir($path) {
@@ -712,7 +716,7 @@ class View {
return false;
}
$defaultRoot = Filesystem::getRoot();
- if($this->fakeRoot === $defaultRoot){
+ if ($this->fakeRoot === $defaultRoot) {
return true;
}
return (strlen($this->fakeRoot) > strlen($defaultRoot)) && (substr($this->fakeRoot, 0, strlen($defaultRoot) + 1) === $defaultRoot . '/');
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list