summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-11-18 14:54:08 +0100
committerMorris Jobke <hey@morrisjobke.de>2014-11-18 18:51:57 +0100
commitf3ab4f3faf9c6f07c14cba406188d56a1e81b676 (patch)
tree93749ed4dc09064439c3860eb04419a6944647bf /apps/files_sharing/lib
parent5f07fb15dccb40339c326c0294f4d73a1d6e77b6 (diff)
downloadnextcloud-server-f3ab4f3faf9c6f07c14cba406188d56a1e81b676.tar.gz
nextcloud-server-f3ab4f3faf9c6f07c14cba406188d56a1e81b676.zip
Don't disclose relative directory path for single shared files of user
The "dir" key is used within the public sharing template to indicate in which directory the user currently is when sharing a directory with subdirectories. This is needed by the JS scripts. However, when not accessing a directory then "dir" was set to the relative path of the file (from the user's home directory), meaning that for every public shared file the sharee can see the path. (For example if you share the file "foo.txt" from "finances/topsecret/" the sharee would still see the path "finances/topsecret/" from the shared HTML template) This is not the excpected behaviour and can be considered a privacy problem, this patch addresses this by setting "dir" to an empty key.
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r--apps/files_sharing/lib/controllers/sharecontroller.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/controllers/sharecontroller.php b/apps/files_sharing/lib/controllers/sharecontroller.php
index e5fd0f401c2..da0761837d8 100644
--- a/apps/files_sharing/lib/controllers/sharecontroller.php
+++ b/apps/files_sharing/lib/controllers/sharecontroller.php
@@ -172,7 +172,7 @@ class ShareController extends Controller {
$shareTmpl['sharingToken'] = $token;
$shareTmpl['server2serversharing'] = Helper::isOutgoingServer2serverShareEnabled();
$shareTmpl['protected'] = isset($linkItem['share_with']) ? 'true' : 'false';
- $shareTmpl['dir'] = $dir;
+ $shareTmpl['dir'] = '';
$shareTmpl['fileSize'] = \OCP\Util::humanFileSize(\OC\Files\Filesystem::filesize($originalSharePath));
// Show file list