diff options
author | Git'Fellow <12234510+solracsf@users.noreply.github.com> | 2024-12-10 09:39:00 +0100 |
---|---|---|
committer | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2024-12-10 18:27:31 +0100 |
commit | f86fb0fee2b9742b5f15e25cb79baed9d407331a (patch) | |
tree | 912e2a7fbba4c7f64f1fdce94a74a4a0178aa53a /apps | |
parent | 28ec9c7e80e825aea2537f865e2862aecf25c8f1 (diff) | |
download | nextcloud-server-f86fb0fee2b9742b5f15e25cb79baed9d407331a.tar.gz nextcloud-server-f86fb0fee2b9742b5f15e25cb79baed9d407331a.zip |
fix(share): Don't print twice the same informationprintOnlyOnceText
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/sharebymail/lib/ShareByMailProvider.php | 4 | ||||
-rw-r--r-- | apps/sharebymail/tests/ShareByMailProviderTest.php | 24 |
2 files changed, 7 insertions, 21 deletions
diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php index 9efc0ec2513..a9e6add2359 100644 --- a/apps/sharebymail/lib/ShareByMailProvider.php +++ b/apps/sharebymail/lib/ShareByMailProvider.php @@ -333,7 +333,6 @@ class ShareByMailProvider extends DefaultShareProvider implements IShareProvider $emailTemplate->setSubject($this->l->t('%1$s shared %2$s with you', [$initiatorDisplayName, $filename])); $emailTemplate->addHeader(); $emailTemplate->addHeading($this->l->t('%1$s shared %2$s with you', [$initiatorDisplayName, $filename]), false); - $text = $this->l->t('%1$s shared %2$s with you.', [$initiatorDisplayName, $filename]); if ($note !== '') { $emailTemplate->addBodyListItem( @@ -354,8 +353,7 @@ class ShareByMailProvider extends DefaultShareProvider implements IShareProvider } $emailTemplate->addBodyText( - htmlspecialchars($text . ' ' . $this->l->t('Click the button below to open it.')), - $text + $this->l->t('Click the button below to open it.') ); $emailTemplate->addBodyButton( diff --git a/apps/sharebymail/tests/ShareByMailProviderTest.php b/apps/sharebymail/tests/ShareByMailProviderTest.php index 9f5434dbe5a..f7325fc248a 100644 --- a/apps/sharebymail/tests/ShareByMailProviderTest.php +++ b/apps/sharebymail/tests/ShareByMailProviderTest.php @@ -1292,10 +1292,7 @@ class ShareByMailProviderTest extends TestCase { $template ->expects($this->once()) ->method('addBodyText') - ->with( - 'Mrs. Owner User shared file.txt with you. Click the button below to open it.', - 'Mrs. Owner User shared file.txt with you.' - ); + ->with('Click the button below to open it.'); $template ->expects($this->once()) ->method('addBodyButton') @@ -1405,7 +1402,7 @@ class ShareByMailProviderTest extends TestCase { $template ->expects($this->once()) ->method('addBodyText') - ->with('Mrs. Owner User shared file.txt with you. Click the button below to open it.', 'Mrs. Owner User shared file.txt with you.'); + ->with('Click the button below to open it.'); $this->urlGenerator->expects($this->once())->method('imagePath') ->with('core', 'caldav/description.png') @@ -1531,7 +1528,7 @@ class ShareByMailProviderTest extends TestCase { $template ->expects($this->once()) ->method('addBodyText') - ->with('Mrs. Owner User shared file.txt with you. Click the button below to open it.', 'Mrs. Owner User shared file.txt with you.'); + ->with('Click the button below to open it.'); $expiration = new DateTime('2001-01-01'); $this->l->expects($this->once()) @@ -1663,10 +1660,7 @@ class ShareByMailProviderTest extends TestCase { $template ->expects($this->once()) ->method('addBodyText') - ->with( - 'Mr. Initiator User shared file.txt with you. Click the button below to open it.', - 'Mr. Initiator User shared file.txt with you.' - ); + ->with('Click the button below to open it.'); $template ->expects($this->once()) ->method('addBodyButton') @@ -1767,10 +1761,7 @@ class ShareByMailProviderTest extends TestCase { $template ->expects($this->once()) ->method('addBodyText') - ->with( - 'Mrs. Owner User shared file.txt with you. Click the button below to open it.', - 'Mrs. Owner User shared file.txt with you.' - ); + ->with('Click the button below to open it.'); $template ->expects($this->once()) ->method('addBodyButton') @@ -1875,10 +1866,7 @@ class ShareByMailProviderTest extends TestCase { $template ->expects($this->once()) ->method('addBodyText') - ->with( - 'Mr. Initiator User shared file.txt with you. Click the button below to open it.', - 'Mr. Initiator User shared file.txt with you.' - ); + ->with('Click the button below to open it.'); $template ->expects($this->once()) ->method('addBodyButton') |