summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files_sharing/public.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index ac889cd2dcb..b478ac8a4ad 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -3,6 +3,16 @@ $RUNTIME_NOSETUPFS = true;
// Load other apps for file previews
OC_App::loadApps();
+function fileCmp($a, $b) {
+ if ($a['type'] == 'dir' and $b['type'] != 'dir') {
+ return -1;
+ } elseif ($a['type'] != 'dir' and $b['type'] == 'dir') {
+ return 1;
+ } else {
+ return strnatcasecmp($a['name'], $b['name']);
+ }
+}
+
if (isset($_GET['t'])) {
$token = $_GET['t'];
$linkItem = OCP\Share::getShareByToken($token);
@@ -146,6 +156,8 @@ if (isset($path)) {
$i['permissions'] = OCP\PERMISSION_READ;
$files[] = $i;
}
+ usort($files, "fileCmp");
+
// Make breadcrumb
$breadcrumb = array();
$pathtohere = '';