summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBorjan Tchakaloff <borjan@tchakaloff.fr>2011-10-05 14:27:50 +0400
committerBorjan Tchakaloff <borjan@tchakaloff.fr>2011-10-05 14:27:50 +0400
commit0cde2a314656b1818d15b64139cca038930e0c24 (patch)
treeeab0d143c38cf32780223bbdadc6c5d2a5b2d5d0
parent2c95c799e6b4b433dccb6efe04fe2c6dc9e5d9f9 (diff)
downloadnextcloud-server-0cde2a314656b1818d15b64139cca038930e0c24.tar.gz
nextcloud-server-0cde2a314656b1818d15b64139cca038930e0c24.zip
Fixed the file sharing listing bug (filename is empty when it has no extension in a publicly shared folder).
-rw-r--r--apps/files_sharing/get.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/files_sharing/get.php b/apps/files_sharing/get.php
index 083f48e1127..38f4b2daedc 100644
--- a/apps/files_sharing/get.php
+++ b/apps/files_sharing/get.php
@@ -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'] == "/") {