Fixed the file sharing listing bug (filename is empty when it has no extension in a publicly shared folder).

This commit is contained in:
Borjan Tchakaloff 2011-10-05 14:27:50 +04:00
parent 2c95c799e6
commit 0cde2a3146
1 changed files with 3 additions and 2 deletions

View File

@ -30,8 +30,9 @@ if ($source !== false) {
foreach (OC_Files::getdirectorycontent($source) as $i) {
$i['date'] = OC_Util::formatDate($i['mtime'] );
if ($i['type'] == 'file') {
$i['extention'] = substr($i['name'], strrpos($i['name'], "."));
$i['basename'] = substr($i['name'], 0, strrpos($i['name'], "."));
$fileinfo = pathinfo($i['name']);
$i['basename'] = $fileinfo['filename'];
$i['extention'] = isset($fileinfo['extension']) ? ('.'.$fileinfo['extension']) : '';
}
$i['directory'] = substr($i['directory'], $rootLength);
if ($i['directory'] == "/") {