Skip to content

Commit

Permalink
Merge pull request #12262 from owncloud/removeAbsoluteDirectoryPathFr…
Browse files Browse the repository at this point in the history
…omTemplate

Don't disclose relative directory path for single shared files of user
  • Loading branch information
MorrisJobke committed Nov 25, 2014
2 parents bc3c835 + a6ebb17 commit 6fb2477
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions apps/files_sharing/lib/controllers/sharecontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
use OCP\IRequest;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Http\RedirectResponse;
use OCP\AppFramework\IApi;
use OC\URLGenerator;
use OC\AppConfig;
use OCP\ILogger;
Expand Down Expand Up @@ -159,7 +158,6 @@ public function showShare($token, $path = '') {
$originalSharePath .= $path;
}

$dir = dirname($originalSharePath);
$file = basename($originalSharePath);

$shareTmpl = array();
Expand All @@ -171,7 +169,7 @@ public function showShare($token, $path = '') {
$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
Expand Down
2 changes: 1 addition & 1 deletion apps/files_sharing/public.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@

$urlGenerator = new \OC\URLGenerator(\OC::$server->getConfig());
$token = isset($_GET['t']) ? $_GET['t'] : '';
$route = isset($_GET['download']) ? 'files_sharing.sharecontroller.downloadshare' : 'files_sharing.sharecontroller.showshare';
$route = isset($_GET['download']) ? 'files_sharing.sharecontroller.downloadShare' : 'files_sharing.sharecontroller.showShare';

OC_Response::redirect($urlGenerator->linkToRoute($route, array('token' => $token)));
2 changes: 1 addition & 1 deletion apps/files_sharing/tests/controller/sharecontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public function testShowShare() {
'sharingToken' => $this->token,
'server2serversharing' => true,
'protected' => 'true',
'dir' => '/',
'dir' => '',
'downloadURL' => null,
'fileSize' => '33 B'
);
Expand Down

0 comments on commit 6fb2477

Please sign in to comment.