From b23ad579dc674d3fdeaed0c6f650a6fcb8de6394 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Mon, 1 Oct 2012 14:39:47 +0200 Subject: [PATCH] Sharing: backward compatibility to links from OC 4.0. --- apps/files_sharing/public.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php index 525ffa8357..15377680ab 100644 --- a/apps/files_sharing/public.php +++ b/apps/files_sharing/public.php @@ -1,6 +1,26 @@ execute(array($_GET['token']))->fetchOne(); + if(isset($filepath)) { + $info = OC_FileCache_Cached::get($filepath, ''); + if(strtolower($info['mimetype']) == 'httpd/unix-directory') { + $_GET['dir'] = $filepath; + } else { + $_GET['file'] = $filepath; + } + \OCP\Util::writeLog('files_sharing', 'You have files that are shared by link originating from ownCloud 4.0. Redistribute the new links, because backwards compatibility will be removed in ownCloud 5.', \OCP\Util::WARN); + } +} +// Enf of backward compatibility + if (isset($_GET['file']) || isset($_GET['dir'])) { if (isset($_GET['dir'])) { $type = 'folder';