From b491408a0c2aa723e332eb27af7f6911e3d9615d Mon Sep 17 00:00:00 2001 From: ansuz Date: Fri, 2 Apr 2021 10:05:29 +0530 Subject: [PATCH 1/4] guard against type errors when users' extensions mangle URLs --- www/support/inner.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/www/support/inner.js b/www/support/inner.js index 0c70e7900..aee0e347a 100644 --- a/www/support/inner.js +++ b/www/support/inner.js @@ -203,6 +203,7 @@ define([ }; var showCategories = function (cat) { hideCategories(); + if (!Array.isArray(cat)) { return void console.error("invalid category"); } cat.forEach(function (c) { APP.$rightside.find('.'+c).show(); }); @@ -214,6 +215,7 @@ define([ var metadataMgr = common.getMetadataMgr(); var privateData = metadataMgr.getPrivateData(); var active = privateData.category || 'tickets'; + if (!categories[active]) { active = 'tickets'; } common.setHash(active); Object.keys(categories).forEach(function (key) { var $category = $('
', { From 6bcb2a65e612d85d2c6d282649071b40e32df7a1 Mon Sep 17 00:00:00 2001 From: ansuz Date: Fri, 2 Apr 2021 10:07:07 +0530 Subject: [PATCH 2/4] leave a note to fix a spreadsheet bug --- www/common/onlyoffice/inner.js | 1 + 1 file changed, 1 insertion(+) diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index ef43b06b0..f82b95153 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -2466,6 +2466,7 @@ define([ newDoc = !content.hashes || Object.keys(content.hashes).length === 0; } else if (!privateData.isNewFile) { // This is an empty doc but not a new file: error + // XXX clear cache before reloading UI.errorLoadingScreen(Messages.unableToDisplay, false, function () { common.gotoURL(''); }); From 0d60b08702c496756b8b43b54a9063f9300ead38 Mon Sep 17 00:00:00 2001 From: ansuz Date: Fri, 2 Apr 2021 19:30:48 +0530 Subject: [PATCH 3/4] test that XLSX export headers are correctly set in checkup app --- .../src/less2/pages/page-checkup.less | 2 +- www/checkup/main.js | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/customize.dist/src/less2/pages/page-checkup.less b/customize.dist/src/less2/pages/page-checkup.less index 2a05600c7..9119a4b72 100644 --- a/customize.dist/src/less2/pages/page-checkup.less +++ b/customize.dist/src/less2/pages/page-checkup.less @@ -52,7 +52,7 @@ html, body { .advisory-text { display: inline-block; - word-break: break-all; + word-break: break-word; padding: 5px; //font-size: 16px; border: 1px solid red; diff --git a/www/checkup/main.js b/www/checkup/main.js index 5dcd1e8cf..42864b4f3 100644 --- a/www/checkup/main.js +++ b/www/checkup/main.js @@ -202,6 +202,24 @@ define([ }, _alert("Login block is not working (write/read/remove)")); + assert(function (cb) { + var url = '/common/onlyoffice/v4/web-apps/apps/spreadsheeteditor/main/index.html'; + var expect = { + 'cross-origin-resource-policy': 'cross-origin', + 'cross-origin-embedder-policy': 'require-corp', + }; + + $.ajax(url, { + success: function (data, textStatus, xhr) { + cb(!Object.keys(expect).some(function (k) { + var response = xhr.getResponseHeader(k); + console.log(k, response); + return response !== expect[k]; + })); + }, + }); + }, _alert("Missing HTTP headers required for XLSX export")); + var row = function (cells) { return h('tr', cells.map(function (cell) { return h('td', cell); From 79a238a65a6b91c135e7a155ef6c3343a7bc42e5 Mon Sep 17 00:00:00 2001 From: ansuz Date: Fri, 2 Apr 2021 19:37:51 +0530 Subject: [PATCH 4/4] update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f7a78c0fc..8c602e292 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ * don't try to join invalid channels * don't try to get their metadata * prompt premium users to cancel their subscriptions before deleting their accounts +* check that headers for XLSX export are correctly set via the checkup app +* guard against some type errors in the support page # 4.3.1