diff options
author | Roeland Jago Douma <rullzer@owncloud.com> | 2016-03-14 15:19:55 +0100 |
---|---|---|
committer | Roeland Jago Douma <rullzer@owncloud.com> | 2016-03-15 11:10:24 +0100 |
commit | 1db82073a4a36e5fb324630ef5529405ad69713b (patch) | |
tree | 2a22694b1789dc50118158cc1ea05d92eda8f2c0 /lib | |
parent | f8180579d03fcd10ab8f92f1ecb27899436c7653 (diff) | |
download | nextcloud-server-1db82073a4a36e5fb324630ef5529405ad69713b.tar.gz nextcloud-server-1db82073a4a36e5fb324630ef5529405ad69713b.zip |
Generate a valid URL for link notification
fixes #23197
* Updated unit test
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/share/mailnotifications.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/private/share/mailnotifications.php b/lib/private/share/mailnotifications.php index a664d4ebf47..f71651e71fc 100644 --- a/lib/private/share/mailnotifications.php +++ b/lib/private/share/mailnotifications.php @@ -30,6 +30,7 @@ namespace OC\Share; use DateTime; use OCP\IL10N; +use OCP\IURLGenerator; use OCP\IUser; use OCP\Mail\IMailer; use OCP\ILogger; @@ -57,6 +58,8 @@ class MailNotifications { private $defaults; /** @var ILogger */ private $logger; + /** @var IURLGenerator */ + private $urlGenerator; /** * @param IUser $user @@ -64,17 +67,20 @@ class MailNotifications { * @param IMailer $mailer * @param ILogger $logger * @param Defaults $defaults + * @param IURLGenerator $urlGenerator */ public function __construct(IUser $user, IL10N $l10n, IMailer $mailer, ILogger $logger, - Defaults $defaults) { + Defaults $defaults, + IURLGenerator $urlGenerator) { $this->l = $l10n; $this->user = $user; $this->mailer = $mailer; $this->logger = $logger; $this->defaults = $defaults; + $this->urlGenerator = $urlGenerator; $this->replyTo = $this->user->getEMailAddress(); $this->senderDisplayName = $this->user->getDisplayName(); @@ -131,7 +137,10 @@ class MailNotifications { ); } - $link = Util::linkToAbsolute('files', 'index.php', $args); + $link = $this->urlGenerator->linkToRouteAbsolute( + 'files.view.index', + $args + ); list($htmlBody, $textBody) = $this->createMailBody($filename, $link, $expiration, 'internal'); |