From 0011d83bccbd4a9d0a225d5be61e016ca24d807f Mon Sep 17 00:00:00 2001 From: Git'Fellow <12234510+solracsf@users.noreply.github.com> Date: Tue, 10 Dec 2024 09:39:00 +0100 Subject: fix(share): Don't print twice the same information Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> --- apps/sharebymail/lib/ShareByMailProvider.php | 4 +--- apps/sharebymail/tests/ShareByMailProviderTest.php | 24 ++++++---------------- 2 files changed, 7 insertions(+), 21 deletions(-) (limited to 'apps') diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php index fd844128827..d159e4ef5e0 100644 --- a/apps/sharebymail/lib/ShareByMailProvider.php +++ b/apps/sharebymail/lib/ShareByMailProvider.php @@ -331,7 +331,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( @@ -352,8 +351,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 ae5d768b624..92219a7e9bb 100644 --- a/apps/sharebymail/tests/ShareByMailProviderTest.php +++ b/apps/sharebymail/tests/ShareByMailProviderTest.php @@ -1305,10 +1305,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') @@ -1418,7 +1415,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') @@ -1544,7 +1541,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()) @@ -1676,10 +1673,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') @@ -1780,10 +1774,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') @@ -1888,10 +1879,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') -- cgit v1.2.3