From 826df5765caf9a38d82999b40457ef8b79372f34 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Fri, 15 Jun 2018 10:27:21 +0100
Subject: [PATCH 1/3] add rel noopener to cross origin loader (currently
 rel="undefined")

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
 src/components/views/messages/MFileBody.js | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/components/views/messages/MFileBody.js b/src/components/views/messages/MFileBody.js
index 246ea6891f..292ac25d42 100644
--- a/src/components/views/messages/MFileBody.js
+++ b/src/components/views/messages/MFileBody.js
@@ -327,6 +327,7 @@ module.exports = React.createClass({
                     // will have the correct name when the user tries to download it.
                     // We can't provide a Content-Disposition header like we would for HTTP.
                     download: fileName,
+                    rel: "noopener",
                     target: "_blank",
                     textContent: _t("Download %(text)s", { text: text }),
                 }, "*");

From da93c6d04076e01fbbfe3a692c5e5a3705f5a9e0 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Fri, 15 Jun 2018 10:27:39 +0100
Subject: [PATCH 2/3] pass omitFilename to stop sending filename=undefined

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
 src/ContentMessages.js | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/ContentMessages.js b/src/ContentMessages.js
index 7fe625f8b9..1d61b6de6a 100644
--- a/src/ContentMessages.js
+++ b/src/ContentMessages.js
@@ -243,6 +243,7 @@ function uploadFile(matrixClient, roomId, file, progressHandler) {
             const blob = new Blob([encryptResult.data]);
             return matrixClient.uploadContent(blob, {
                 progressHandler: progressHandler,
+                omitFilename: true,
             }).then(function(url) {
                 // If the attachment is encrypted then bundle the URL along
                 // with the information needed to decrypt the attachment and

From 1ae51a83328362581d2df74b10469d7ebba60866 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Mon, 18 Jun 2018 13:48:23 +0100
Subject: [PATCH 3/3] use changed argument in js-sdk

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
 src/ContentMessages.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ContentMessages.js b/src/ContentMessages.js
index 1d61b6de6a..fd21977108 100644
--- a/src/ContentMessages.js
+++ b/src/ContentMessages.js
@@ -243,7 +243,7 @@ function uploadFile(matrixClient, roomId, file, progressHandler) {
             const blob = new Blob([encryptResult.data]);
             return matrixClient.uploadContent(blob, {
                 progressHandler: progressHandler,
-                omitFilename: true,
+                includeFilename: false,
             }).then(function(url) {
                 // If the attachment is encrypted then bundle the URL along
                 // with the information needed to decrypt the attachment and