summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-01-14 11:28:53 +0100
committerGitHub <noreply@github.com>2022-01-14 11:28:53 +0100
commit6264f5aef74a505cda72c6edfedbb6f68f500ee9 (patch)
treed7b2ac318a6d6291cec0c9119fd650bba26eaa67 /apps
parent6a7b088adb95c2afb725cae7e02f1a39a153b2d9 (diff)
parent46c0ceb59c0d42d575fb36e7e982452e946505be (diff)
downloadnextcloud-server-6264f5aef74a505cda72c6edfedbb6f68f500ee9.tar.gz
nextcloud-server-6264f5aef74a505cda72c6edfedbb6f68f500ee9.zip
Merge pull request #30655 from nextcloud/fix/sizing-publi-download-page
Improve layout for the public download page
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/lib/Controller/ShareController.php2
-rw-r--r--apps/files_sharing/templates/public.php4
-rw-r--r--apps/files_sharing/tests/Controller/ShareControllerTest.php8
3 files changed, 7 insertions, 7 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php
index 614dae7ffba..b4a332d7419 100644
--- a/apps/files_sharing/lib/Controller/ShareController.php
+++ b/apps/files_sharing/lib/Controller/ShareController.php
@@ -385,7 +385,7 @@ class ShareController extends AuthPublicShareController {
$shareTmpl['protected'] = $share->getPassword() !== null ? 'true' : 'false';
$shareTmpl['dir'] = '';
$shareTmpl['nonHumanFileSize'] = $shareNode->getSize();
- $shareTmpl['fileSize'] = \OCP\Util::humanFileSize($shareNode->getSize());
+ $shareTmpl['fileSize'] = str_replace(' ', '&nbsp;', \OCP\Util::humanFileSize($shareNode->getSize()));
$shareTmpl['hideDownload'] = $share->getHideDownload();
$hideFileList = false;
diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php
index 832e8a00b1a..677f015ce81 100644
--- a/apps/files_sharing/templates/public.php
+++ b/apps/files_sharing/templates/public.php
@@ -75,7 +75,7 @@ $maxUploadFilesize = min($upload_max_filesize, $post_max_size);
<?php if (isset($_['mimetype']) && strpos($_['mimetype'], 'image') === 0) { ?>
<div class="directDownload">
<div>
- <?php p($_['filename'])?> (<?php p($_['fileSize']) ?>)
+ <?php p($_['filename'])?> (<?php echo($_['fileSize']) ?>)
</div>
<a href="<?php p($_['downloadURL']); ?>" id="downloadFile" class="button">
<span class="icon icon-download"></span>
@@ -87,7 +87,7 @@ $maxUploadFilesize = min($upload_max_filesize, $post_max_size);
<?php if ($_['previewURL'] === $_['downloadURL'] && !$_['hideDownload']): ?>
<div class="directDownload">
<div>
- <?php p($_['filename'])?> (<?php p($_['fileSize']) ?>)
+ <?php p($_['filename'])?> (<?php echo($_['fileSize']) ?>)
</div>
<a href="<?php p($_['downloadURL']); ?>" id="downloadFile" class="button">
<span class="icon icon-download"></span>
diff --git a/apps/files_sharing/tests/Controller/ShareControllerTest.php b/apps/files_sharing/tests/Controller/ShareControllerTest.php
index be2616f70fc..512a61d811e 100644
--- a/apps/files_sharing/tests/Controller/ShareControllerTest.php
+++ b/apps/files_sharing/tests/Controller/ShareControllerTest.php
@@ -329,7 +329,7 @@ class ShareControllerTest extends \Test\TestCase {
'protected' => 'true',
'dir' => '',
'downloadURL' => 'downloadURL',
- 'fileSize' => '33 B',
+ 'fileSize' => '33&nbsp;B',
'nonHumanFileSize' => 33,
'maxSizeAnimateGif' => 10,
'previewSupported' => true,
@@ -480,7 +480,7 @@ class ShareControllerTest extends \Test\TestCase {
'protected' => 'true',
'dir' => '',
'downloadURL' => 'downloadURL',
- 'fileSize' => '33 B',
+ 'fileSize' => '33&nbsp;B',
'nonHumanFileSize' => 33,
'maxSizeAnimateGif' => 10,
'previewSupported' => true,
@@ -631,7 +631,7 @@ class ShareControllerTest extends \Test\TestCase {
'protected' => 'true',
'dir' => '',
'downloadURL' => 'downloadURL',
- 'fileSize' => '33 B',
+ 'fileSize' => '33&nbsp;B',
'nonHumanFileSize' => 33,
'maxSizeAnimateGif' => 10,
'previewSupported' => true,
@@ -756,7 +756,7 @@ class ShareControllerTest extends \Test\TestCase {
'protected' => 'false',
'dir' => null,
'downloadURL' => '',
- 'fileSize' => '1 KB',
+ 'fileSize' => '1&nbsp;KB',
'nonHumanFileSize' => 1337,
'maxSizeAnimateGif' => null,
'previewSupported' => null,