From a93f2a648b2694dcebc3dffd9ca391c1303ce381 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Thu, 12 Jul 2018 14:55:50 +0200 Subject: allow to add a personal note to a share Signed-off-by: Bjoern Schiessle --- apps/sharebymail/lib/ShareByMailProvider.php | 60 ++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) (limited to 'apps/sharebymail') diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php index 1a1855b9c44..bf251c627a0 100644 --- a/apps/sharebymail/lib/ShareByMailProvider.php +++ b/apps/sharebymail/lib/ShareByMailProvider.php @@ -506,6 +506,61 @@ class ShareByMailProvider implements IShareProvider { return true; } + protected function sendNote(IShare $share) { + + $recipient = $share->getSharedWith(); + + + $filename = $share->getNode()->getName(); + $initiator = $share->getSharedBy(); + $note = $share->getNote(); + + $initiatorUser = $this->userManager->get($initiator); + $initiatorDisplayName = ($initiatorUser instanceof IUser) ? $initiatorUser->getDisplayName() : $initiator; + $initiatorEmailAddress = ($initiatorUser instanceof IUser) ? $initiatorUser->getEMailAddress() : null; + + $plainBodyPart = $this->l->t("%s shared »%s« with you and want to add:\n", [$initiatorDisplayName, $filename]); + $htmlBodyPart = $this->l->t('%s shared »%s« with you and want to add:', [$initiatorDisplayName, $filename]); + + $message = $this->mailer->createMessage(); + + $emailTemplate = $this->mailer->createEMailTemplate('shareByMail.sendNote', [ + 'filename' => $filename, + 'note' => $note, + 'initiator' => $initiatorDisplayName, + 'initiatorEmail' => $initiatorEmailAddress, + 'shareWith' => $recipient, + ]); + + $emailTemplate->setSubject($this->l->t('»%s« added a note to a file shared with you', [$initiatorDisplayName])); + $emailTemplate->addHeader(); + $emailTemplate->addHeading($this->l->t('Note regarding »%s«', [$filename]), false); + $emailTemplate->addBodyText(htmlspecialchars($htmlBodyPart), $plainBodyPart); + $emailTemplate->addBodyText($note); + + // The "From" contains the sharers name + $instanceName = $this->defaults->getName(); + $senderName = $this->l->t( + '%s via %s', + [ + $initiatorDisplayName, + $instanceName + ] + ); + $message->setFrom([\OCP\Util::getDefaultEmailAddress($instanceName) => $senderName]); + if ($initiatorEmailAddress !== null) { + $message->setReplyTo([$initiatorEmailAddress => $initiatorDisplayName]); + $emailTemplate->addFooter($instanceName . ' - ' . $this->defaults->getSlogan()); + } else { + $emailTemplate->addFooter(); + } + + $message->setTo([$recipient]); + $message->useTemplate($emailTemplate); + $this->mailer->send($message); + + } + /** * send auto generated password to the owner. This happens if the admin enforces * a password for mail shares and forbid to send the password by mail to the recipient @@ -662,8 +717,13 @@ class ShareByMailProvider implements IShareProvider { ->set('uid_initiator', $qb->createNamedParameter($share->getSharedBy())) ->set('password', $qb->createNamedParameter($share->getPassword())) ->set('expiration', $qb->createNamedParameter($share->getExpirationDate(), IQueryBuilder::PARAM_DATE)) + ->set('note', $qb->createNamedParameter($share->getNote())) ->execute(); + if ($originalShare->getNote() !== $share->getNote() && $share->getNote() !== '') { + $this->sendNote($share); + } + return $share; } -- cgit v1.2.3 From c116d116facb45683514cbb2d175b66e3d3c5c59 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Thu, 12 Jul 2018 16:05:24 +0200 Subject: improve mail template and escape html code Signed-off-by: Bjoern Schiessle --- apps/sharebymail/lib/ShareByMailProvider.php | 17 +++++------------ lib/private/Share20/DefaultShareProvider.php | 17 +++++------------ 2 files changed, 10 insertions(+), 24 deletions(-) (limited to 'apps/sharebymail') diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php index bf251c627a0..0eceeca1cac 100644 --- a/apps/sharebymail/lib/ShareByMailProvider.php +++ b/apps/sharebymail/lib/ShareByMailProvider.php @@ -519,24 +519,17 @@ class ShareByMailProvider implements IShareProvider { $initiatorDisplayName = ($initiatorUser instanceof IUser) ? $initiatorUser->getDisplayName() : $initiator; $initiatorEmailAddress = ($initiatorUser instanceof IUser) ? $initiatorUser->getEMailAddress() : null; - $plainBodyPart = $this->l->t("%s shared »%s« with you and want to add:\n", [$initiatorDisplayName, $filename]); - $htmlBodyPart = $this->l->t('%s shared »%s« with you and want to add:', [$initiatorDisplayName, $filename]); + $plainHeading = $this->l->t('%1s shared »%2s« with you and want to add:', [$initiatorDisplayName, $filename]); + $htmlHeading = $this->l->t('%1s shared »%2s« with you and want to add:', [$initiatorDisplayName, $filename]); $message = $this->mailer->createMessage(); - $emailTemplate = $this->mailer->createEMailTemplate('shareByMail.sendNote', [ - 'filename' => $filename, - 'note' => $note, - 'initiator' => $initiatorDisplayName, - 'initiatorEmail' => $initiatorEmailAddress, - 'shareWith' => $recipient, - ]); + $emailTemplate = $this->mailer->createEMailTemplate('shareByMail.sendNote'); $emailTemplate->setSubject($this->l->t('»%s« added a note to a file shared with you', [$initiatorDisplayName])); $emailTemplate->addHeader(); - $emailTemplate->addHeading($this->l->t('Note regarding »%s«', [$filename]), false); - $emailTemplate->addBodyText(htmlspecialchars($htmlBodyPart), $plainBodyPart); - $emailTemplate->addBodyText($note); + $emailTemplate->addHeading(htmlspecialchars($htmlHeading), $plainHeading); + $emailTemplate->addBodyText(htmlspecialchars($note), $note); // The "From" contains the sharers name $instanceName = $this->defaults->getName(); diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php index 1d7dddcaf4a..86eac45f88e 100644 --- a/lib/private/Share20/DefaultShareProvider.php +++ b/lib/private/Share20/DefaultShareProvider.php @@ -1309,24 +1309,17 @@ class DefaultShareProvider implements IShareProvider { $initiatorDisplayName = ($initiatorUser instanceof IUser) ? $initiatorUser->getDisplayName() : $initiator; $initiatorEmailAddress = ($initiatorUser instanceof IUser) ? $initiatorUser->getEMailAddress() : null; - $plainBodyPart = $this->l->t("%s shared »%s« with you and want to add:\n", [$initiatorDisplayName, $filename]); - $htmlBodyPart = $this->l->t('%s shared »%s« with you and want to add:', [$initiatorDisplayName, $filename]); + $plainHeading = $this->l->t('%1s shared »%2s« with you and want to add:', [$initiatorDisplayName, $filename]); + $htmlHeading = $this->l->t('%1s shared »%2s« with you and want to add:', [$initiatorDisplayName, $filename]); $message = $this->mailer->createMessage(); - $emailTemplate = $this->mailer->createEMailTemplate('defaultShareProvider.sendNote', [ - 'filename' => $filename, - 'note' => $note, - 'initiator' => $initiatorDisplayName, - 'initiatorEmail' => $initiatorEmailAddress, - 'shareWith' => $recipient, - ]); + $emailTemplate = $this->mailer->createEMailTemplate('defaultShareProvider.sendNote'); $emailTemplate->setSubject($this->l->t('»%s« added a note to a file shared with you', [$initiatorDisplayName])); $emailTemplate->addHeader(); - $emailTemplate->addHeading($this->l->t('Note regarding »%s«', [$filename]), false); - $emailTemplate->addBodyText(htmlspecialchars($htmlBodyPart), $plainBodyPart); - $emailTemplate->addBodyText($note); + $emailTemplate->addHeading(htmlspecialchars($htmlHeading), $plainHeading); + $emailTemplate->addBodyText(htmlspecialchars($note), $note); // The "From" contains the sharers name $instanceName = $this->defaults->getName(); -- cgit v1.2.3 From 73b88deeb8942e188a5e1e81f4bfca02412a0c5c Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Thu, 12 Jul 2018 16:09:05 +0200 Subject: add note to share object when reading it from the db Signed-off-by: Bjoern Schiessle --- apps/sharebymail/lib/ShareByMailProvider.php | 1 + lib/private/Share20/DefaultShareProvider.php | 1 + 2 files changed, 2 insertions(+) (limited to 'apps/sharebymail') diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php index 0eceeca1cac..cdef06f5345 100644 --- a/apps/sharebymail/lib/ShareByMailProvider.php +++ b/apps/sharebymail/lib/ShareByMailProvider.php @@ -957,6 +957,7 @@ class ShareByMailProvider implements IShareProvider { ->setPermissions((int)$data['permissions']) ->setTarget($data['file_target']) ->setMailSend((bool)$data['mail_send']) + ->setNote($data['note']) ->setToken($data['token']); $shareTime = new \DateTime(); diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php index 86eac45f88e..8ecd1e811ba 100644 --- a/lib/private/Share20/DefaultShareProvider.php +++ b/lib/private/Share20/DefaultShareProvider.php @@ -910,6 +910,7 @@ class DefaultShareProvider implements IShareProvider { ->setShareType((int)$data['share_type']) ->setPermissions((int)$data['permissions']) ->setTarget($data['file_target']) + ->setNote($data['note']) ->setMailSend((bool)$data['mail_send']); $shareTime = new \DateTime(); -- cgit v1.2.3 From a29261175d1b8062e81239a54d456018d792d3e9 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Thu, 12 Jul 2018 17:07:11 +0200 Subject: fix mail templates Signed-off-by: Bjoern Schiessle --- apps/sharebymail/lib/ShareByMailProvider.php | 6 +++--- lib/private/Share20/DefaultShareProvider.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'apps/sharebymail') diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php index cdef06f5345..50fbd6fa0ed 100644 --- a/apps/sharebymail/lib/ShareByMailProvider.php +++ b/apps/sharebymail/lib/ShareByMailProvider.php @@ -519,8 +519,8 @@ class ShareByMailProvider implements IShareProvider { $initiatorDisplayName = ($initiatorUser instanceof IUser) ? $initiatorUser->getDisplayName() : $initiator; $initiatorEmailAddress = ($initiatorUser instanceof IUser) ? $initiatorUser->getEMailAddress() : null; - $plainHeading = $this->l->t('%1s shared »%2s« with you and want to add:', [$initiatorDisplayName, $filename]); - $htmlHeading = $this->l->t('%1s shared »%2s« with you and want to add:', [$initiatorDisplayName, $filename]); + $plainHeading = $this->l->t('%1$s shared »%2$s« with you and want to add:', [$initiatorDisplayName, $filename]); + $htmlHeading = $this->l->t('%1$s shared »%2$s« with you and want to add:', [$initiatorDisplayName, $filename]); $message = $this->mailer->createMessage(); @@ -534,7 +534,7 @@ class ShareByMailProvider implements IShareProvider { // The "From" contains the sharers name $instanceName = $this->defaults->getName(); $senderName = $this->l->t( - '%s via %s', + '%1$s via %2$s', [ $initiatorDisplayName, $instanceName diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php index 8ecd1e811ba..2594b9e2973 100644 --- a/lib/private/Share20/DefaultShareProvider.php +++ b/lib/private/Share20/DefaultShareProvider.php @@ -1310,8 +1310,8 @@ class DefaultShareProvider implements IShareProvider { $initiatorDisplayName = ($initiatorUser instanceof IUser) ? $initiatorUser->getDisplayName() : $initiator; $initiatorEmailAddress = ($initiatorUser instanceof IUser) ? $initiatorUser->getEMailAddress() : null; - $plainHeading = $this->l->t('%1s shared »%2s« with you and want to add:', [$initiatorDisplayName, $filename]); - $htmlHeading = $this->l->t('%1s shared »%2s« with you and want to add:', [$initiatorDisplayName, $filename]); + $plainHeading = $this->l->t('%1$s shared »%2$s« with you and want to add:', [$initiatorDisplayName, $filename]); + $htmlHeading = $this->l->t('%1$s shared »%2$s« with you and want to add:', [$initiatorDisplayName, $filename]); $message = $this->mailer->createMessage(); @@ -1325,7 +1325,7 @@ class DefaultShareProvider implements IShareProvider { // The "From" contains the sharers name $instanceName = $this->defaults->getName(); $senderName = $this->l->t( - '%s via %s', + '%1$s via %2$s', [ $initiatorDisplayName, $instanceName -- cgit v1.2.3 From 1ce519ad38e5c7f56a2c8007517570cac3c94bec Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Thu, 12 Jul 2018 19:32:03 +0200 Subject: add direct link to the share Signed-off-by: Bjoern Schiessle --- apps/sharebymail/lib/ShareByMailProvider.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'apps/sharebymail') diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php index 50fbd6fa0ed..0e4ecded3f9 100644 --- a/apps/sharebymail/lib/ShareByMailProvider.php +++ b/apps/sharebymail/lib/ShareByMailProvider.php @@ -531,6 +531,13 @@ class ShareByMailProvider implements IShareProvider { $emailTemplate->addHeading(htmlspecialchars($htmlHeading), $plainHeading); $emailTemplate->addBodyText(htmlspecialchars($note), $note); + $link = $this->urlGenerator->linkToRouteAbsolute('files_sharing.sharecontroller.showShare', + ['token' => $share->getToken()]); + $emailTemplate->addBodyButton( + $this->l->t('Open »%s«', [$filename]), + $link + ); + // The "From" contains the sharers name $instanceName = $this->defaults->getName(); $senderName = $this->l->t( -- cgit v1.2.3 From b81962e3e865e9187d099bcb958cec9acfc7d593 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Fri, 13 Jul 2018 10:51:22 +0200 Subject: fix unit tests Signed-off-by: Bjoern Schiessle --- apps/sharebymail/tests/ShareByMailProviderTest.php | 18 +++++--- tests/lib/Share20/DefaultShareProviderTest.php | 52 ++++++++++++++++++++-- 2 files changed, 59 insertions(+), 11 deletions(-) (limited to 'apps/sharebymail') diff --git a/apps/sharebymail/tests/ShareByMailProviderTest.php b/apps/sharebymail/tests/ShareByMailProviderTest.php index 95d746cfb46..f0d99e6026c 100644 --- a/apps/sharebymail/tests/ShareByMailProviderTest.php +++ b/apps/sharebymail/tests/ShareByMailProviderTest.php @@ -342,15 +342,17 @@ class ShareByMailProviderTest extends TestCase { $uidOwner = 'user2'; $permissions = 1; $token = 'token'; + $note = 'personal note'; $instance = $this->getInstance(); - $id = $this->createDummyShare($itemType, $itemSource, $shareWith, $sharedBy, $uidOwner, $permissions, $token); + $id = $this->createDummyShare($itemType, $itemSource, $shareWith, $sharedBy, $uidOwner, $permissions, $token, $note); $this->share->expects($this->once())->method('getPermissions')->willReturn($permissions + 1); $this->share->expects($this->once())->method('getShareOwner')->willReturn($uidOwner); $this->share->expects($this->once())->method('getSharedBy')->willReturn($sharedBy); + $this->share->expects($this->any())->method('getNote')->willReturn($note); $this->share->expects($this->atLeastOnce())->method('getId')->willReturn($id); $this->assertSame($this->share, @@ -372,6 +374,7 @@ class ShareByMailProviderTest extends TestCase { $this->assertSame($uidOwner, $result[0]['uid_owner']); $this->assertSame($permissions + 1, (int)$result[0]['permissions']); $this->assertSame($token, $result[0]['token']); + $this->assertSame($note, $result[0]['note']); } public function testDelete() { @@ -478,7 +481,7 @@ class ShareByMailProviderTest extends TestCase { $instance = $this->getInstance(['createShareObject']); $idMail = $this->createDummyShare($itemType, $itemSource, $shareWith, $sharedBy, $uidOwner, $permissions, $token); - $idPublic = $this->createDummyShare($itemType, $itemSource, $shareWith, $sharedBy, $uidOwner, $permissions, $token, \OCP\Share::SHARE_TYPE_LINK); + $idPublic = $this->createDummyShare($itemType, $itemSource, $shareWith, $sharedBy, $uidOwner, $permissions, $token, '', \OCP\Share::SHARE_TYPE_LINK); $this->assertTrue($idMail !== $idPublic); @@ -490,9 +493,9 @@ class ShareByMailProviderTest extends TestCase { } ); - $this->assertInstanceOf('OCP\Share\IShare', - $instance->getShareByToken('token') - ); + $result = $instance->getShareByToken('token'); + + $this->assertInstanceOf('OCP\Share\IShare', $result); } /** @@ -511,7 +514,7 @@ class ShareByMailProviderTest extends TestCase { $instance = $this->getInstance(['createShareObject']); $idMail = $this->createDummyShare($itemType, $itemSource, $shareWith, $sharedBy, $uidOwner, $permissions, $token); - $idPublic = $this->createDummyShare($itemType, $itemSource, $shareWith, $sharedBy, $uidOwner, $permissions, "token2", \OCP\Share::SHARE_TYPE_LINK); + $idPublic = $this->createDummyShare($itemType, $itemSource, $shareWith, $sharedBy, $uidOwner, $permissions, "token2", '', \OCP\Share::SHARE_TYPE_LINK); $this->assertTrue($idMail !== $idPublic); @@ -631,7 +634,7 @@ class ShareByMailProviderTest extends TestCase { $this->invokePrivate($instance, 'getRawShare', [$id+1]); } - private function createDummyShare($itemType, $itemSource, $shareWith, $sharedBy, $uidOwner, $permissions, $token, $shareType = \OCP\Share::SHARE_TYPE_EMAIL) { + private function createDummyShare($itemType, $itemSource, $shareWith, $sharedBy, $uidOwner, $permissions, $token, $note='', $shareType = \OCP\Share::SHARE_TYPE_EMAIL) { $qb = $this->connection->getQueryBuilder(); $qb->insert('share') ->setValue('share_type', $qb->createNamedParameter($shareType)) @@ -643,6 +646,7 @@ class ShareByMailProviderTest extends TestCase { ->setValue('uid_initiator', $qb->createNamedParameter($sharedBy)) ->setValue('permissions', $qb->createNamedParameter($permissions)) ->setValue('token', $qb->createNamedParameter($token)) + ->setValue('note', $qb->createNamedParameter($note)) ->setValue('stime', $qb->createNamedParameter(time())); /* diff --git a/tests/lib/Share20/DefaultShareProviderTest.php b/tests/lib/Share20/DefaultShareProviderTest.php index 230c8db40ce..19f37160627 100644 --- a/tests/lib/Share20/DefaultShareProviderTest.php +++ b/tests/lib/Share20/DefaultShareProviderTest.php @@ -22,15 +22,19 @@ namespace Test\Share20; use OCP\DB\QueryBuilder\IQueryBuilder; +use OCP\Defaults; use OCP\Files\File; use OCP\Files\Folder; use OCP\IDBConnection; use OCP\IGroup; +use OCP\IL10N; +use OCP\IURLGenerator; use OCP\IUser; use OCP\IUserManager; use OCP\IGroupManager; use OCP\Files\IRootFolder; use OC\Share20\DefaultShareProvider; +use OCP\Mail\IMailer; use OCP\Share\IShare; /** @@ -56,11 +60,27 @@ class DefaultShareProviderTest extends \Test\TestCase { /** @var DefaultShareProvider */ protected $provider; + /** @var \PHPUnit_Framework_MockObject_MockObject|IMailer */ + protected $mailer; + + /** @var \PHPUnit_Framework_MockObject_MockObject|IL10N */ + protected $l10n; + + /** @var \PHPUnit_Framework_MockObject_MockObject|Defaults */ + protected $defaults; + + /** @var \PHPUnit_Framework_MockObject_MockObject|IURLGenerator */ + protected $urlGenerator; + public function setUp() { $this->dbConn = \OC::$server->getDatabaseConnection(); $this->userManager = $this->createMock(IUserManager::class); $this->groupManager = $this->createMock(IGroupManager::class); $this->rootFolder = $this->createMock(IRootFolder::class); + $this->mailer = $this->createMock(IMailer::class); + $this->l10n = $this->createMock(IL10N::class); + $this->defaults = $this->getMockBuilder(Defaults::class)->disableOriginalConstructor()->getMock(); + $this->urlGenerator = $this->createMock(IURLGenerator::class); $this->userManager->expects($this->any())->method('userExists')->willReturn(true); @@ -71,7 +91,11 @@ class DefaultShareProviderTest extends \Test\TestCase { $this->dbConn, $this->userManager, $this->groupManager, - $this->rootFolder + $this->rootFolder, + $this->mailer, + $this->defaults, + $this->l10n, + $this->urlGenerator ); } @@ -403,6 +427,10 @@ class DefaultShareProviderTest extends \Test\TestCase { $this->userManager, $this->groupManager, $this->rootFolder, + $this->mailer, + $this->defaults, + $this->l10n, + $this->urlGenerator ]) ->setMethods(['getShareById']) ->getMock(); @@ -493,6 +521,10 @@ class DefaultShareProviderTest extends \Test\TestCase { $this->userManager, $this->groupManager, $this->rootFolder, + $this->mailer, + $this->defaults, + $this->l10n, + $this->urlGenerator ]) ->setMethods(['getShareById']) ->getMock(); @@ -2368,7 +2400,11 @@ class DefaultShareProviderTest extends \Test\TestCase { $this->dbConn, $userManager, $groupManager, - $rootFolder + $rootFolder, + $this->mailer, + $this->defaults, + $this->l10n, + $this->urlGenerator ); $password = md5(time()); @@ -2461,7 +2497,11 @@ class DefaultShareProviderTest extends \Test\TestCase { $this->dbConn, $userManager, $groupManager, - $rootFolder + $rootFolder, + $this->mailer, + $this->defaults, + $this->l10n, + $this->urlGenerator ); $u1 = $userManager->createUser('testShare1', 'test'); @@ -2552,7 +2592,11 @@ class DefaultShareProviderTest extends \Test\TestCase { $this->dbConn, $userManager, $groupManager, - $rootFolder + $rootFolder, + $this->mailer, + $this->defaults, + $this->l10n, + $this->urlGenerator ); $u1 = $userManager->createUser('testShare1', 'test'); -- cgit v1.2.3 From eab4d96c4cf200c095de64258d96b791700a7cf4 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Fri, 13 Jul 2018 12:09:15 +0200 Subject: some small template fixes Signed-off-by: Bjoern Schiessle --- apps/files_sharing/templates/public.php | 2 +- apps/sharebymail/lib/ShareByMailProvider.php | 4 ++-- lib/private/Share20/DefaultShareProvider.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'apps/sharebymail') diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php index e337eb9b7f3..4aedf986962 100644 --- a/apps/files_sharing/templates/public.php +++ b/apps/files_sharing/templates/public.php @@ -33,7 +33,7 @@ $maxUploadFilesize = min($upload_max_filesize, $post_max_size);
- t('Note: ')); p($_['note']); ?> + t('Note:')); p(' ' . $_['note']); ?>
diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php index 0e4ecded3f9..73e962e3292 100644 --- a/apps/sharebymail/lib/ShareByMailProvider.php +++ b/apps/sharebymail/lib/ShareByMailProvider.php @@ -519,8 +519,8 @@ class ShareByMailProvider implements IShareProvider { $initiatorDisplayName = ($initiatorUser instanceof IUser) ? $initiatorUser->getDisplayName() : $initiator; $initiatorEmailAddress = ($initiatorUser instanceof IUser) ? $initiatorUser->getEMailAddress() : null; - $plainHeading = $this->l->t('%1$s shared »%2$s« with you and want to add:', [$initiatorDisplayName, $filename]); - $htmlHeading = $this->l->t('%1$s shared »%2$s« with you and want to add:', [$initiatorDisplayName, $filename]); + $plainHeading = $this->l->t('%1$s shared »%2$s« with you and wants to add:', [$initiatorDisplayName, $filename]); + $htmlHeading = $this->l->t('%1$s shared »%2$s« with you and wants to add', [$initiatorDisplayName, $filename]); $message = $this->mailer->createMessage(); diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php index f5e32de424e..9c5d78a5958 100644 --- a/lib/private/Share20/DefaultShareProvider.php +++ b/lib/private/Share20/DefaultShareProvider.php @@ -1316,8 +1316,8 @@ class DefaultShareProvider implements IShareProvider { $initiatorUser = $this->userManager->get($initiator); $initiatorDisplayName = ($initiatorUser instanceof IUser) ? $initiatorUser->getDisplayName() : $initiator; $initiatorEmailAddress = ($initiatorUser instanceof IUser) ? $initiatorUser->getEMailAddress() : null; - $plainHeading = $this->l->t('%1$s shared »%2$s« with you and want to add:', [$initiatorDisplayName, $filename]); - $htmlHeading = $this->l->t('%1$s shared »%2$s« with you and want to add:', [$initiatorDisplayName, $filename]); + $plainHeading = $this->l->t('%1$s shared »%2$s« with you and wants to add:', [$initiatorDisplayName, $filename]); + $htmlHeading = $this->l->t('%1$s shared »%2$s« with you and wants to add', [$initiatorDisplayName, $filename]); $message = $this->mailer->createMessage(); $emailTemplate = $this->mailer->createEMailTemplate('defaultShareProvider.sendNote'); -- cgit v1.2.3