Skip to content

Commit

Permalink
Return empty array if file does not exist inside Shared folder, fixes…
Browse files Browse the repository at this point in the history
… issue #91
  • Loading branch information
Michael Gapczynski committed Nov 5, 2012
1 parent b7e9d8d commit 3d13c9d
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 3d13c9d

Please sign in to comment.