Skip to content

Commit 46c0ceb

Browse files
committed
Add non-breaking space in the file size
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
1 parent 2e55ce0 commit 46c0ceb

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

apps/files_sharing/lib/Controller/ShareController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ public function showShare($path = ''): TemplateResponse {
385385
$shareTmpl['protected'] = $share->getPassword() !== null ? 'true' : 'false';
386386
$shareTmpl['dir'] = '';
387387
$shareTmpl['nonHumanFileSize'] = $shareNode->getSize();
388-
$shareTmpl['fileSize'] = \OCP\Util::humanFileSize($shareNode->getSize());
388+
$shareTmpl['fileSize'] = str_replace(' ', '&nbsp;', \OCP\Util::humanFileSize($shareNode->getSize()));
389389
$shareTmpl['hideDownload'] = $share->getHideDownload();
390390

391391
$hideFileList = false;

apps/files_sharing/templates/public.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
<?php if (isset($_['mimetype']) && strpos($_['mimetype'], 'image') === 0) { ?>
7676
<div class="directDownload">
7777
<div>
78-
<?php p($_['filename'])?> (<?php p($_['fileSize']) ?>)
78+
<?php p($_['filename'])?> (<?php echo($_['fileSize']) ?>)
7979
</div>
8080
<a href="<?php p($_['downloadURL']); ?>" id="downloadFile" class="button">
8181
<span class="icon icon-download"></span>
@@ -87,7 +87,7 @@
8787
<?php if ($_['previewURL'] === $_['downloadURL'] && !$_['hideDownload']): ?>
8888
<div class="directDownload">
8989
<div>
90-
<?php p($_['filename'])?>&nbsp;(<?php p($_['fileSize']) ?>)
90+
<?php p($_['filename'])?> (<?php echo($_['fileSize']) ?>)
9191
</div>
9292
<a href="<?php p($_['downloadURL']); ?>" id="downloadFile" class="button">
9393
<span class="icon icon-download"></span>

apps/files_sharing/tests/Controller/ShareControllerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ public function testShowShare() {
329329
'protected' => 'true',
330330
'dir' => '',
331331
'downloadURL' => 'downloadURL',
332-
'fileSize' => '33 B',
332+
'fileSize' => '33&nbsp;B',
333333
'nonHumanFileSize' => 33,
334334
'maxSizeAnimateGif' => 10,
335335
'previewSupported' => true,
@@ -480,7 +480,7 @@ public function testShowShareWithPrivateName() {
480480
'protected' => 'true',
481481
'dir' => '',
482482
'downloadURL' => 'downloadURL',
483-
'fileSize' => '33 B',
483+
'fileSize' => '33&nbsp;B',
484484
'nonHumanFileSize' => 33,
485485
'maxSizeAnimateGif' => 10,
486486
'previewSupported' => true,
@@ -631,7 +631,7 @@ public function testShowShareHideDownload() {
631631
'protected' => 'true',
632632
'dir' => '',
633633
'downloadURL' => 'downloadURL',
634-
'fileSize' => '33 B',
634+
'fileSize' => '33&nbsp;B',
635635
'nonHumanFileSize' => 33,
636636
'maxSizeAnimateGif' => 10,
637637
'previewSupported' => true,
@@ -756,7 +756,7 @@ public function testShareFileDrop() {
756756
'protected' => 'false',
757757
'dir' => null,
758758
'downloadURL' => '',
759-
'fileSize' => '1 KB',
759+
'fileSize' => '1&nbsp;KB',
760760
'nonHumanFileSize' => 1337,
761761
'maxSizeAnimateGif' => null,
762762
'previewSupported' => null,

0 commit comments

Comments
 (0)