Skip to content

Commit

Permalink
Merge pull request #33342 from owncloud/stable10-backport33138
Browse files Browse the repository at this point in the history
[stable10] Email subject is already escaped, avoid double escaping
  • Loading branch information
Vincent Petry authored Oct 29, 2018
2 parents ecd19ce + 2d59577 commit e06074e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/private/Share/MailNotifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,11 @@ public function sendInternalShareMail($recipientList, $itemSource, $itemType) {
'file' => $filename,
]);

$unescapedFilename = $filename;
$filename = $filter->getFile();
$link = $filter->getLink();

$subject = (string) $this->l->t('%s shared »%s« with you', [$this->senderDisplayName, $filename]);
$subject = (string) $this->l->t('%s shared »%s« with you', [$this->senderDisplayName, $unescapedFilename]);
list($htmlBody, $textBody) = $this->createMailBody($filename, $link, $expiration, null, 'internal');

// send it out now
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/Share/MailNotificationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ public function testSendLinkShareMailException($to, $cc, $bcc, $toList, $expecte
}

public function testSendInternalShareMail() {
$this->setupMailerMock('TestUser shared »<welcome>.txt« with you', ['recipient@owncloud.com' => 'Recipient'], false);
$this->setupMailerMock('TestUser shared »<welcome>.txt« with you', ['recipient@owncloud.com' => 'Recipient'], false);

/** @var MailNotifications | \PHPUnit_Framework_MockObject_MockObject $mailNotifications */
$mailNotifications = $this->getMockBuilder('OC\Share\MailNotifications')
Expand Down Expand Up @@ -441,7 +441,7 @@ public function testSendInternalShareMail() {
}

public function testSendInternalShareMailException() {
$this->setupMailerMock('TestUser shared »&lt;welcome&gt;.txt« with you', ['recipient@owncloud.com' => 'Recipient'], false);
$this->setupMailerMock('TestUser shared »<welcome>.txt« with you', ['recipient@owncloud.com' => 'Recipient'], false);

/** @var MailNotifications | \PHPUnit_Framework_MockObject_MockObject $mailNotifications */
$mailNotifications = $this->getMockBuilder('OC\Share\MailNotifications')
Expand Down

0 comments on commit e06074e

Please sign in to comment.