Skip to content

Commit

Permalink
Merge pull request #273 from owncloud/fix_webdav_shared_91
Browse files Browse the repository at this point in the history
Return empty array if file does not exist inside Shared folder, fixes issue #91
  • Loading branch information
blizzz committed Nov 6, 2012
2 parents bb40d14 + 3d13c9d commit bfaed9a
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions lib/files.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,16 @@ public static function getFileInfo($path) {
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);
Expand Down

0 comments on commit bfaed9a

Please sign in to comment.