diff options
Diffstat (limited to 'apps')
7 files changed, 34 insertions, 26 deletions
diff --git a/apps/dav/lib/Upload/AssemblyStream.php b/apps/dav/lib/Upload/AssemblyStream.php index ecd73cdf518..e42a1ceb9e5 100644 --- a/apps/dav/lib/Upload/AssemblyStream.php +++ b/apps/dav/lib/Upload/AssemblyStream.php @@ -73,7 +73,7 @@ class AssemblyStream implements \Icewind\Streams\File { $this->loadContext('assembly'); $nodes = $this->nodes; - // http://stackoverflow.com/a/10985500 + // https://stackoverflow.com/a/10985500 @usort($nodes, function (IFile $a, IFile $b) { return strnatcmp($a->getName(), $b->getName()); }); diff --git a/apps/files_sharing/appinfo/routes.php b/apps/files_sharing/appinfo/routes.php index a4edada738c..8915f135ba2 100644 --- a/apps/files_sharing/appinfo/routes.php +++ b/apps/files_sharing/appinfo/routes.php @@ -50,9 +50,10 @@ return [ ], [ 'name' => 'Share#downloadShare', - 'url' => '/s/{token}/download', + 'url' => '/s/{token}/download/{filename}', 'verb' => 'GET', 'root' => '', + 'defaults' => ['filename' => ''] ], [ 'name' => 'PublicPreview#directLink', diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php index 359382441d6..fdf69abd9ac 100644 --- a/apps/files_sharing/lib/Controller/ShareController.php +++ b/apps/files_sharing/lib/Controller/ShareController.php @@ -414,7 +414,10 @@ class ShareController extends AuthPublicShareController { $shareTmpl['showgridview'] = false; $shareTmpl['hideFileList'] = $hideFileList; - $shareTmpl['downloadURL'] = $this->urlGenerator->linkToRouteAbsolute('files_sharing.sharecontroller.downloadShare', ['token' => $this->getToken()]); + $shareTmpl['downloadURL'] = $this->urlGenerator->linkToRouteAbsolute('files_sharing.sharecontroller.downloadShare', [ + 'token' => $this->getToken(), + 'filename' => $shareIsFolder ? null : $shareNode->getName() + ]); $shareTmpl['shareUrl'] = $this->urlGenerator->linkToRouteAbsolute('files_sharing.sharecontroller.showShare', ['token' => $this->getToken()]); $shareTmpl['maxSizeAnimateGif'] = $this->config->getSystemValue('max_filesize_animated_gifs_public_sharing', 10); $shareTmpl['previewEnabled'] = $this->config->getSystemValue('enable_previews', true); diff --git a/apps/files_sharing/tests/Controller/ShareControllerTest.php b/apps/files_sharing/tests/Controller/ShareControllerTest.php index 18b663f09bc..33dff13cafe 100644 --- a/apps/files_sharing/tests/Controller/ShareControllerTest.php +++ b/apps/files_sharing/tests/Controller/ShareControllerTest.php @@ -211,6 +211,7 @@ class ShareControllerTest extends \Test\TestCase { public function testShowShare() { $note = 'personal note'; + $filename = 'file1.txt'; $this->shareController->setToken('token'); @@ -225,7 +226,7 @@ class ShareControllerTest extends \Test\TestCase { $initiator->method('isEnabled')->willReturn(true); $file = $this->createMock(File::class); - $file->method('getName')->willReturn('file1.txt'); + $file->method('getName')->willReturn($filename); $file->method('getMimetype')->willReturn('text/plain'); $file->method('getSize')->willReturn(33); $file->method('isReadable')->willReturn(true); @@ -250,14 +251,14 @@ class ShareControllerTest extends \Test\TestCase { ->setSharedBy('initiatorUID') ->setNode($file) ->setNote($note) - ->setTarget('/file1.txt'); + ->setTarget("/$filename"); $this->session->method('exists')->with('public_link_authenticated')->willReturn(true); $this->session->method('get')->with('public_link_authenticated')->willReturn('42'); $this->urlGenerator->expects($this->at(0)) ->method('linkToRouteAbsolute') - ->with('files_sharing.sharecontroller.downloadShare', ['token' => 'token']) + ->with('files_sharing.sharecontroller.downloadShare', ['token' => 'token', 'filename' => $filename]) ->willReturn('downloadURL'); $this->previewManager->method('isMimeSupported')->with('text/plain')->willReturn(true); @@ -312,8 +313,8 @@ class ShareControllerTest extends \Test\TestCase { $response = $this->shareController->showShare(); $sharedTmplParams = [ 'owner' => 'ownerUID', - 'filename' => 'file1.txt', - 'directory_path' => '/file1.txt', + 'filename' => $filename, + 'directory_path' => "/$filename", 'mimetype' => 'text/plain', 'dirToken' => 'token', 'sharingToken' => 'token', @@ -357,6 +358,7 @@ class ShareControllerTest extends \Test\TestCase { public function testShowShareWithPrivateName() { $note = 'personal note'; + $filename = 'file1.txt'; $this->shareController->setToken('token'); @@ -371,7 +373,7 @@ class ShareControllerTest extends \Test\TestCase { $initiator->method('isEnabled')->willReturn(true); $file = $this->createMock(File::class); - $file->method('getName')->willReturn('file1.txt'); + $file->method('getName')->willReturn($filename); $file->method('getMimetype')->willReturn('text/plain'); $file->method('getSize')->willReturn(33); $file->method('isReadable')->willReturn(true); @@ -396,14 +398,14 @@ class ShareControllerTest extends \Test\TestCase { ->setSharedBy('initiatorUID') ->setNode($file) ->setNote($note) - ->setTarget('/file1.txt'); + ->setTarget("/$filename"); $this->session->method('exists')->with('public_link_authenticated')->willReturn(true); $this->session->method('get')->with('public_link_authenticated')->willReturn('42'); $this->urlGenerator->expects($this->at(0)) ->method('linkToRouteAbsolute') - ->with('files_sharing.sharecontroller.downloadShare', ['token' => 'token']) + ->with('files_sharing.sharecontroller.downloadShare', ['token' => 'token', 'filename' => $filename]) ->willReturn('downloadURL'); $this->previewManager->method('isMimeSupported')->with('text/plain')->willReturn(true); @@ -458,8 +460,8 @@ class ShareControllerTest extends \Test\TestCase { $response = $this->shareController->showShare(); $sharedTmplParams = [ 'owner' => '', - 'filename' => 'file1.txt', - 'directory_path' => '/file1.txt', + 'filename' => $filename, + 'directory_path' => "/$filename", 'mimetype' => 'text/plain', 'dirToken' => 'token', 'sharingToken' => 'token', @@ -503,6 +505,7 @@ class ShareControllerTest extends \Test\TestCase { public function testShowShareHideDownload() { $note = 'personal note'; + $filename = 'file1.txt'; $this->shareController->setToken('token'); @@ -517,7 +520,7 @@ class ShareControllerTest extends \Test\TestCase { $initiator->method('isEnabled')->willReturn(true); $file = $this->getMockBuilder('OCP\Files\File')->getMock(); - $file->method('getName')->willReturn('file1.txt'); + $file->method('getName')->willReturn($filename); $file->method('getMimetype')->willReturn('text/plain'); $file->method('getSize')->willReturn(33); $file->method('isReadable')->willReturn(true); @@ -542,7 +545,7 @@ class ShareControllerTest extends \Test\TestCase { ->setSharedBy('initiatorUID') ->setNode($file) ->setNote($note) - ->setTarget('/file1.txt') + ->setTarget("/$filename") ->setHideDownload(true); $this->session->method('exists')->with('public_link_authenticated')->willReturn(true); @@ -553,7 +556,7 @@ class ShareControllerTest extends \Test\TestCase { // files. $this->urlGenerator->expects($this->at(0)) ->method('linkToRouteAbsolute') - ->with('files_sharing.sharecontroller.downloadShare', ['token' => 'token']) + ->with('files_sharing.sharecontroller.downloadShare', ['token' => 'token', 'filename' => $filename]) ->willReturn('downloadURL'); $this->previewManager->method('isMimeSupported')->with('text/plain')->willReturn(true); @@ -608,8 +611,8 @@ class ShareControllerTest extends \Test\TestCase { $response = $this->shareController->showShare(); $sharedTmplParams = [ 'owner' => 'ownerUID', - 'filename' => 'file1.txt', - 'directory_path' => '/file1.txt', + 'filename' => $filename, + 'directory_path' => "/$filename", 'mimetype' => 'text/plain', 'dirToken' => 'token', 'sharingToken' => 'token', @@ -774,6 +777,7 @@ class ShareControllerTest extends \Test\TestCase { public function testShowShareInvalid() { $this->expectException(\OCP\Files\NotFoundException::class); + $filename = 'file1.txt'; $this->shareController->setToken('token'); $owner = $this->getMockBuilder(IUser::class)->getMock(); @@ -781,7 +785,7 @@ class ShareControllerTest extends \Test\TestCase { $owner->method('getUID')->willReturn('ownerUID'); $file = $this->getMockBuilder('OCP\Files\File')->getMock(); - $file->method('getName')->willReturn('file1.txt'); + $file->method('getName')->willReturn($filename); $file->method('getMimetype')->willReturn('text/plain'); $file->method('getSize')->willReturn(33); $file->method('isShareable')->willReturn(false); @@ -792,7 +796,7 @@ class ShareControllerTest extends \Test\TestCase { $share->setPassword('password') ->setShareOwner('ownerUID') ->setNode($file) - ->setTarget('/file1.txt'); + ->setTarget("/$filename"); $this->session->method('exists')->with('public_link_authenticated')->willReturn(true); $this->session->method('get')->with('public_link_authenticated')->willReturn('42'); diff --git a/apps/settings/templates/settings/admin/server.php b/apps/settings/templates/settings/admin/server.php index c848ef5c494..45203e48901 100644 --- a/apps/settings/templates/settings/admin/server.php +++ b/apps/settings/templates/settings/admin/server.php @@ -78,7 +78,7 @@ print_unescaped('checked="checked"'); } ?>> <label for="backgroundjobs_ajax">AJAX</label><br/> - <em><?php p($l->t("Execute one task with each page loaded")); ?></em> + <em><?php p($l->t("Execute one task with each page loaded.")); ?></em> </p> <p> <input type="radio" name="mode" value="webcron" class="radio" diff --git a/apps/settings/templates/settings/admin/sharing.php b/apps/settings/templates/settings/admin/sharing.php index bd75b04eedb..59915c581e7 100644 --- a/apps/settings/templates/settings/admin/sharing.php +++ b/apps/settings/templates/settings/admin/sharing.php @@ -163,7 +163,7 @@ <?php if ($_['allowShareDialogUserEnumeration'] === 'yes') { print_unescaped('checked="checked"'); } ?> /> - <label for="shareapi_allow_share_dialog_user_enumeration"><?php p($l->t('Allow username autocompletion in share dialog. If this is disabled the full username or email address needs to be entered.'));?></label><br /> + <label for="shareapi_allow_share_dialog_user_enumeration"><?php p($l->t('Allow username autocompletion in share dialog (if this is disabled the full username or email address needs to be entered)'));?></label><br /> </p> <p id="shareapi_restrict_user_enumeration_to_group_setting" class="indent <?php if ($_['shareAPIEnabled'] === 'no' || $_['allowShareDialogUserEnumeration'] === 'no') { @@ -181,7 +181,7 @@ <?php if ($_['publicShareDisclaimerText'] !== null) { print_unescaped('checked="checked"'); } ?> /> - <label for="publicShareDisclaimer"><?php p($l->t('Show disclaimer text on the public link upload page. (Only shown when the file list is hidden.)'));?></label> + <label for="publicShareDisclaimer"><?php p($l->t('Show disclaimer text on the public link upload page (only shown when the file list is hidden)'));?></label> <span id="publicShareDisclaimerStatus" class="msg" style="display:none"></span> <br/> <textarea placeholder="<?php p($l->t('This text will be shown on the public link upload page when the file list is hidden.')) ?>" id="publicShareDisclaimerText" <?php if ($_['publicShareDisclaimerText'] === null) { diff --git a/apps/workflowengine/lib/Check/RequestRemoteAddress.php b/apps/workflowengine/lib/Check/RequestRemoteAddress.php index 00d3d9b2577..abc13bf9e38 100644 --- a/apps/workflowengine/lib/Check/RequestRemoteAddress.php +++ b/apps/workflowengine/lib/Check/RequestRemoteAddress.php @@ -95,7 +95,7 @@ class RequestRemoteAddress implements ICheck { } /** - * Based on http://stackoverflow.com/a/594134 + * Based on https://stackoverflow.com/a/594134 * @param string $ip * @param string $rangeIp * @param int $bits @@ -109,7 +109,7 @@ class RequestRemoteAddress implements ICheck { } /** - * Based on http://stackoverflow.com/a/7951507 + * Based on https://stackoverflow.com/a/7951507 * @param string $ip * @param string $rangeIp * @param int $bits @@ -128,7 +128,7 @@ class RequestRemoteAddress implements ICheck { } /** - * Based on http://stackoverflow.com/a/7951507 + * Based on https://stackoverflow.com/a/7951507 * @param string $packedIp * @return string */ |