diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2012-11-05 17:54:23 -0500 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2012-11-05 17:54:23 -0500 |
commit | 3d13c9db700522854a2fd6e4af624b921f062c8f (patch) | |
tree | ce059c9522f81b6318f103496f93970262b8fa87 /lib/files.php | |
parent | b7e9d8d00e08faa16d67e7469ef5af94dbca7cfc (diff) | |
download | nextcloud-server-3d13c9db700522854a2fd6e4af624b921f062c8f.tar.gz nextcloud-server-3d13c9db700522854a2fd6e4af624b921f062c8f.zip |
Return empty array if file does not exist inside Shared folder, fixes issue #91
Diffstat (limited to 'lib/files.php')
-rw-r--r-- | lib/files.php | 17 |
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); |