Merge pull request #273 from owncloud/fix_webdav_shared_91

Return empty array if file does not exist inside Shared folder, fixes issue #91
This commit is contained in:
blizzz 2012-11-06 04:39:39 -08:00
commit bfaed9a8b6
1 changed files with 10 additions and 7 deletions

View File

@ -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);