diff options
author | Vincent Petry <pvince81@owncloud.com> | 2013-11-14 18:39:39 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2013-11-19 15:05:11 +0100 |
commit | 5b6d1d79d06e404ce4a52f75393a98f52769da48 (patch) | |
tree | d9e08530b8d4885a5ee9ac9af3891ba75e563da6 /apps/files_external | |
parent | 8ab40f195984e76ec1fe8e89c8f0081f6bb7a418 (diff) | |
download | nextcloud-server-5b6d1d79d06e404ce4a52f75393a98f52769da48.tar.gz nextcloud-server-5b6d1d79d06e404ce4a52f75393a98f52769da48.zip |
Fixed SMB file deletion success detection
Since unlink() smb4php doesn't return true on deletion success, we need
to check whether the file was deleted to confirm success.
Fixes #5866
Diffstat (limited to 'apps/files_external')
-rw-r--r-- | apps/files_external/lib/smb.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php index c464fa9107a..5bff597fdca 100644 --- a/apps/files_external/lib/smb.php +++ b/apps/files_external/lib/smb.php @@ -82,6 +82,18 @@ class SMB extends \OC\Files\Storage\StreamWrapper{ } /** + * Unlinks file + * @param string @path + */ + public function unlink($path) { + unlink($this->constructUrl($path)); + clearstatcache(); + // smb4php still returns false even on success so + // check here whether file was really deleted + return !file_exists($path); + } + + /** * check if a file or folder has been updated since $time * @param string $path * @param int $time |