Commit 6fb2477f authored by Morris Jobke's avatar Morris Jobke
Browse files

Merge pull request #12262 from owncloud/removeAbsoluteDirectoryPathFromTemplate

Don't disclose relative directory path for single shared files of user
parents bc3c835f a6ebb176
...@@ -23,7 +23,6 @@ use OCP\AppFramework\Controller; ...@@ -23,7 +23,6 @@ use OCP\AppFramework\Controller;
use OCP\IRequest; use OCP\IRequest;
use OCP\AppFramework\Http\TemplateResponse; use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Http\RedirectResponse; use OCP\AppFramework\Http\RedirectResponse;
use OCP\AppFramework\IApi;
use OC\URLGenerator; use OC\URLGenerator;
use OC\AppConfig; use OC\AppConfig;
use OCP\ILogger; use OCP\ILogger;
...@@ -159,7 +158,6 @@ class ShareController extends Controller { ...@@ -159,7 +158,6 @@ class ShareController extends Controller {
$originalSharePath .= $path; $originalSharePath .= $path;
} }
$dir = dirname($originalSharePath);
$file = basename($originalSharePath); $file = basename($originalSharePath);
$shareTmpl = array(); $shareTmpl = array();
...@@ -171,7 +169,7 @@ class ShareController extends Controller { ...@@ -171,7 +169,7 @@ class ShareController extends Controller {
$shareTmpl['sharingToken'] = $token; $shareTmpl['sharingToken'] = $token;
$shareTmpl['server2serversharing'] = Helper::isOutgoingServer2serverShareEnabled(); $shareTmpl['server2serversharing'] = Helper::isOutgoingServer2serverShareEnabled();
$shareTmpl['protected'] = isset($linkItem['share_with']) ? 'true' : 'false'; $shareTmpl['protected'] = isset($linkItem['share_with']) ? 'true' : 'false';
$shareTmpl['dir'] = $dir; $shareTmpl['dir'] = '';
$shareTmpl['fileSize'] = \OCP\Util::humanFileSize(\OC\Files\Filesystem::filesize($originalSharePath)); $shareTmpl['fileSize'] = \OCP\Util::humanFileSize(\OC\Files\Filesystem::filesize($originalSharePath));
// Show file list // Show file list
......
...@@ -12,6 +12,6 @@ ...@@ -12,6 +12,6 @@
$urlGenerator = new \OC\URLGenerator(\OC::$server->getConfig()); $urlGenerator = new \OC\URLGenerator(\OC::$server->getConfig());
$token = isset($_GET['t']) ? $_GET['t'] : ''; $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))); OC_Response::redirect($urlGenerator->linkToRoute($route, array('token' => $token)));
...@@ -153,7 +153,7 @@ class ShareControllerTest extends \PHPUnit_Framework_TestCase { ...@@ -153,7 +153,7 @@ class ShareControllerTest extends \PHPUnit_Framework_TestCase {
'sharingToken' => $this->token, 'sharingToken' => $this->token,
'server2serversharing' => true, 'server2serversharing' => true,
'protected' => 'true', 'protected' => 'true',
'dir' => '/', 'dir' => '',
'downloadURL' => null, 'downloadURL' => null,
'fileSize' => '33 B' 'fileSize' => '33 B'
); );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment