summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorblizzz <blizzz@owncloud.com>2012-11-06 04:39:39 -0800
committerblizzz <blizzz@owncloud.com>2012-11-06 04:39:39 -0800
commitbfaed9a8b629d1c1c54ada7bcf1bc85011cf20fe (patch)
tree2af61afe413d83634b7f114c02f5c409f5d23e56
parentbb40d14efafb79472f8a56ff8e55219014d4b0ff (diff)
parent3d13c9db700522854a2fd6e4af624b921f062c8f (diff)
downloadnextcloud-server-bfaed9a8b629d1c1c54ada7bcf1bc85011cf20fe.tar.gz
nextcloud-server-bfaed9a8b629d1c1c54ada7bcf1bc85011cf20fe.zip
Merge pull request #273 from owncloud/fix_webdav_shared_91
Return empty array if file does not exist inside Shared folder, fixes issue #91
-rw-r--r--lib/files.php17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/files.php b/lib/files.php
index 5a14083c285..3e15c68d885 100644
--- a/lib/files.php
+++ b/lib/files.php
@@ -45,13 +45,16 @@ class OC_Files {
if (($path == '/Shared' || substr($path, 0, 8) == '/Shared/') && OC_App::isEnabled('files_sharing')) {
if ($path == '/Shared') {
list($info) = OCP\Share::getItemsSharedWith('file', OC_Share_Backend_File::FORMAT_FILE_APP_ROOT);
- }else{
- $info['size'] = OC_Filesystem::filesize($path);
- $info['mtime'] = OC_Filesystem::filemtime($path);
- $info['ctime'] = OC_Filesystem::filectime($path);
- $info['mimetype'] = OC_Filesystem::getMimeType($path);
- $info['encrypted'] = false;
- $info['versioned'] = false;
+ } else {
+ $info = array();
+ if (OC_Filesystem::file_exists($path)) {
+ $info['size'] = OC_Filesystem::filesize($path);
+ $info['mtime'] = OC_Filesystem::filemtime($path);
+ $info['ctime'] = OC_Filesystem::filectime($path);
+ $info['mimetype'] = OC_Filesystem::getMimeType($path);
+ $info['encrypted'] = false;
+ $info['versioned'] = false;
+ }
}
} else {
$info = OC_FileCache::get($path);